springboot项目设置linux服务启动
官方文档
https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#deployment-install
项目配置
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<executable>true</executable>
</configuration>
</plugin>
在/etc/init.d目录设置软连接到springboot项目jar
$ sudo ln -s /var/myapp/myapp.jar /etc/init.d/myapp
启动项目
service start myapp
service stop myapp
service restart myapp
或
/etc/init.d/yourapp start|stop|restart
参考:
https://my.oschina.net/u/4292220/blog/3236949 (重点)
https://www.cnblogs.com/sueyyyy/p/9958836.html
以上是 springboot项目设置linux服务启动 的全部内容, 来源链接: utcz.com/z/518189.html