springboot项目 设置linux服务启动 4年前

官方文档

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

image
马猴喵
你...真是本末倒置,罔顾人伦!
7
发布数
1
关注者
4436
累计阅读

热门教程文档

Swift
54小节
Next
43小节
Redis
14小节
Python
76小节
C++
73小节
广告