使用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)\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

 

posted @   快乐就好  阅读(395)  评论(0编辑  收藏  举报
编辑推荐:
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
阅读排行:
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 提示词工程——AI应用必不可少的技术
· Open-Sora 2.0 重磅开源!
· 周边上新:园子的第一款马克杯温暖上架
点击右上角即可分享
微信分享提示