使用winsw将spring-boot jar包注册成windows服务

背景:最近的项目中使用spring-boot,

https://github.com/kohsuke/winsw/releases

1 <service>
 2 
 3      <id>YJPSS</id>
 4 
 5      <name> YJPSS </name>
 6 
 7      <description>This is YJPSS service.</description>
 8 
 9      <!-- java环境变量 -->
10 
11      <env name="JAVA_HOME" value="%JAVA_HOME%"/>
12 
13      <executable>java</executable>
14 
15     <arguments>-jar "F:	estYJPSS.jar"</arguments>
16 
17      <!-- 开机启动 -->
18 
19      <startmode>Automatic</startmode>
20 
21      <!-- 日志配置 -->
22 
23      <logpath>%BASE%log</logpath>
24 
25      <logmode>rotate</logmode>
26 
27  </service>
1 2 3 YJPSS 4 5 YJPSS 6 7 This is YJPSS service. 8 9 10 11 12 13 java 14 15 -jar "F: estYJPSS.jar" 16 17 18 19 Automatic 20 21 22 23 %BASE%log 24 25 rotate 26 27
背景:最近的项目中使用spring-boot, https://github.com/kohsuke/winsw/releases 1 2 3 YJPSS 4 5 YJPSS 6 7 This is YJPSS service. 8 9 10 11 12 13 java 14 15 -jar "F: estYJPSS.jar" 16 17 18 19 Automatic 20 21 22 23 %BASE%log 24 25 rotate 26 27
经验分享 程序员 微信小程序 职场和发展