简体   繁体   English

如何使用sbt-native-packager创建Upstart Zip软件包?

[英]How can I create an Upstart Zip package using sbt-native-packager?

I am unable to generate an upstart zip package. 我无法生成新贵的zip软件包。 I have added the following to my sbt project 我已将以下内容添加到我的sbt项目中

...
enablePlugins(UpstartPlugin).
enablePlugins(JavaServerAppPackaging)

and then run 然后运行

sbt clean universal:packageBin

And a Zip file is produced but it contains the shell script in ./bin and the jars in ./lib that look like what is produced when I use JavaAppPackaging ! 并生成了一个Zip文件,但它包含./bin中的shell脚本和./lib中的jar,它们看起来像我使用JavaAppPackagingJavaAppPackaging

Where are the conf files etc needed for upstart ? upstart所需的conf文件等在哪里? Am I missing the secret sauce or using the wrong incantation? 我是否想念秘密酱料或使用错误的咒语?

Reading all the docs at this page I am under the impression that the archetype plugins determine what goes into my package while the format plugins determine what form the package takes. 阅读本页上的所有文档,我的印象是原型插件确定了包装中包含的内容,而格式插件确定了包装采用何种形式。

So for example I could have a Java Server project that is designed to launch running as a daemon user using the JavaServerAppPackaging (archetype) and adding the daemonUser setting, but then have this bundled up as a Zip or Tar.gz using the Universal (format) plugin or a .deb file using the Debian (format) plugin. 因此,例如,我可以有一个Java Server项目,该项目旨在使用JavaServerAppPackaging (原型)并以daemonUser设置作为守护程序用户启动运行,但随后使用Universal(格式)将其捆绑为Zip或Tar.gz )插件或使用Debian(格式)插件的.deb文件。

Well I want a Java Service with all the files necessary to be started with the upstart System Loader but packaged as a Zip file. 好吧,我想要一个Java服务,其中包含所有必须由upstart系统加载程序启动的文件,但打包为Zip文件。 So I assume I need the upstart (archetype system loader) plugin with the universal (format) plugin. 因此,我假设我需要带有通用 (格式)插件的新贵 (原型系统加载器)插件。

There is even a tip on the system loader docs for the upstart plugin saying 在系统加载器文档中甚至有关于新贵插件的提示,

You can use systemloaders with the Java Application Archetype or the Java Server Application Archetype! 您可以将系统加载程序与Java应用程序原型或Java服务器应用程序原型一起使用!

Well that exactly what I want however it doesn't state how to do it! 好吧,这正是我想要的, 但是并没有说明如何去做!

Please can someone tell me how to get a zip bundle with an upstart layout that starts a Java Server application? 有人可以告诉我如何获得具有新贵布局的zip捆绑包,以启动Java Server应用程序吗? And if you can point out the documentation I have clearly missed than that would help my understanding too :-) 如果您能指出我显然错过的文档,那也将有助于我的理解:-)

Cheers 干杯

Karl 卡尔

Thanks for ready the docs so carefully and sorry that the docs are lacking an explanation what package types support system loaders. 感谢您如此仔细地准备好文档,对于文档缺少解释哪些软件包类型支持系统加载程序的文档,我们深表歉意。

The short answer is: only rpm and debian packages support system loaders ( systemd, systemV and upstart ). 简短的答案是:只有rpmdebian软件包支持系统加载程序(systemd,systemV和upstart)。

Why is that so? 为什么会这样? A system loader is tight to the target operation system. 系统加载程序与目标操作系统紧密相关。 It's nothing universal , which is the reason it's not in there. 这不是通用的 ,这就是它不存在的原因。 The configuration files and or scripts and platform dependent and this is not part of your regular application directory. 配置文件和/或脚本和平台相关,并且这不是常规应用程序目录的一部分。

Cheers, Muki 干杯,Muki

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM