Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 10 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(3)
Linux 上的服务只是启动后台进程的 shell 脚本。查看
/etc/init.d
- 您可以在文本编辑器中打开这些文件。您所需要的只是一个 bash 脚本,它以适当的方式响应参数start
和stop
(例如start
将启动您的服务并记录已知位置的进程 ID,stop
将使用您创建的文件中的 PID 终止该进程),然后将其放入/etc/init.d
中。查看 初始化脚本 和 服务、运行级别、和 rc.d 脚本
Services on Linux are just shell scripts which start background processes. Have a look in
/etc/init.d
- you can open the files in a text editor. All you need is a bash script which responds to the parametersstart
andstop
in an appropriate way (eg.start
will start your service and record the process ID in a known location,stop
will kill the process with the PID from the file you created), and then place it in/etc/init.d
.Have a look at Init Scripts and An introduction to services, runlevels, and rc.d scripts
据我所知,Apache Daemon 或 Akuma 都没有 Maven 插件。尽管您可以尝试使用 maven-exec-plugin。
至于您的公司对使用 GPL 许可产品的保留意见,值得阅读一下使用的影响。它并不像企业担心的那么致命。这是GPL 的解释。当然,它在法律上没有任何影响力(并且可能不正确或没有先例支持,我不是律师),但可能足以让您与法律人员开始对话。
从引用的页面:
我认为 Appassembler Maven 插件 可以满足您的需求(尽管它确实创建 JSW 包装器)。它创建一个 shell 脚本(和一个 bat 文件),并将所有应用程序 jar 收集到一个目录中。可以选择配置以创建基于 JSW 的守护程序配置。
以下是一个示例配置,它将在 target/appassembler 文件夹中生成独立应用程序,并在 target/appassembler/jsw/myApp 目录中生成 JSW 包装器文件。请注意,组装目标绑定到集成测试阶段,以确保创建项目的 jar。要生成输出,请运行 mvn verify 或仅生成服务包装器,请运行 mvn package:
作为参考,生成的文件如下:
As far as I know there isn't a Maven plugin for either Apache Daemon or Akuma. Though you could attempt to invoke them from within a Maven build by using the maven-exec-plugin.
As far as your companies reservations about using GPL-licensed products, it's worth reading up on the implications of use. It is not as virulent as corporations fear. Here's an interpretation of the GPL. It of course doesn't carry any weight in law (and may not be correct or supported by precedent, I am not a lawyer), but might be sufficient to allow you to start a conversation with your legal people.
From the referenced page:
There is the Appassembler Maven plugin that I think does what you need (though it does create JSW wrappers). It creates a shell script (and a bat file), and collects all the application jars into a directory. It can optionally be configured to create JSW-based Daemon configurations.
Here is an example configuration that will generate the standalone application in the target/appassembler folder, and generate the JSW wrapper files in the target/appassembler/jsw/myApp directory. Note the assemble goal is bound to the integration-test phase to ensure the project's jar is created. To generate the output run mvn verify or to just generate the service wrappers run mvn package:
For reference the generated files are as follows:
您可以看看以下项目。
You can look at the following projects.