码迷,mamicode.com
首页 > 编程语言 > 详细

springboot 2.x centos 7.0 部署

时间:2020-05-30 15:37:58      阅读:58      评论:0      收藏:0      [点我收藏+]

标签:down   xxxxx   serve   imp   use   type   targe   snapshot   conf   

1  pom

<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<mainClass>com.xx.xxApplication</mainClass>
</configuration>
</plugin>

2 application.properties
server.port=xxxx   (部署端口号)

3 打好项目jar包(非war)

   mvn clean package

4 yum install -y java-1.8.0-openjdk-devel.x86_64

 

5.cd /etc/systemd/system  

vi xxxxx.service

[Unit]
Description=xxxx service
After=syslog.target

[Service]
Type=simple
ExecStart= /usr/bin/java -jar xxxx-0.0.1-SNAPSHOT.jar

[Install]
WantedBy=multi-user.target

 

6  systemctl enable xxxx.service

 

7  shutdown -r now 

 

done!!!

springboot 2.x centos 7.0 部署

标签:down   xxxxx   serve   imp   use   type   targe   snapshot   conf   

原文地址:https://www.cnblogs.com/Garin/p/12992792.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!