0 spring-mvc spring-integration spring-boot
我如何将 Spring Boot 应用程序作为 Windows 服务运行,因为我正在关注winsw 的 spring 文档。
脚步:
winsw.1.19.exe.而接下来他们要求更换winsw.exe,以myApp.exe和他们提到我需要修改配置文件安装指南,但我没有收到哪里是哪里,我需要进行更改配置文件。
注意:我的 Spring Boot 应用程序已经作为服务运行,我需要将此服务作为 Windows 服务运行。
该winsw文档提到这个什么配置文件是当你指的也是文档显示一个例子,如何使用它。
想法如下,您将可执行文件重命名为myApp.exe并创建一个名为myApp.xml的 XML 配置文件。我通常是这样配置服务的(尽管它与spring示例有点不同):
<service>
<id>windowsServiceId</id> <!-- Change this -->
<name>Readable name of the windows service</name><!-- Change this -->
<description>Description of the windows service</description><!-- Change this -->
<workingdirectory>%BASE%\</workingdirectory>
<logpath>%BASE%\logs</logpath>
<executable>java</executable>
<arguments>-jar my-application.jar</arguments><!-- Change this -->
</service>
Run Code Online (Sandbox Code Playgroud)
如果两者都有,则可以运行以下命令来安装 Windows 服务:
myApp.exe install
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
9016 次 |
| 最近记录: |