IT干货网

使用winsw部署spring boot项目

wyy 2022年03月15日 编程设计 223 0

winsw下载地址:IT虾米网

下载的是最新版本的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)\Java\jre1.8.0_131\bin\java.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


评论关闭
IT干货网

微信公众号号:IT虾米 (左侧二维码扫一扫)欢迎添加!