使用winsw部署spring boot项目

winsw下载地址:https://github.com/kohsuke/winsw/releases

下载的是最新版本的WinSW.NET4.exe和sample-minimal.xml

并重命名为projectService.exe,projectService.xml

修改配置文件projectService.xml如下 

<service>
  
  <!-- ID of the service. It should be unique across the Windows system-->
  <id>project</id>
  <!-- Display name of the service -->
  <name>projectService</name>
  <!-- Service description -->
  <description>project Service Desc</description>
  
  <!-- Path to the executable, which should be started -->
  <executable>C:Program Files (x86)Javajre1.8.0_131injava.exe</executable>

  <arguments>-Xmx256m -jar project.jar --spring.profiles.active=local --server.port=8092 --service.register.port=8091
</arguments>
</service>

进入命令行,安装为服务

projectService.exe install

删除服务

projectService.exe uninstall

idea虚拟机参数

-Dserver.port=8092 -Dservice.register.port=8082

命令行启动参数

 java -jar bootsample. jar --server.port=8092 --service.register.port=8082

原文地址:https://www.cnblogs.com/happyday56/p/14685696.html