Springboot项目打包部署到Linux服务器

一. 打包

1.1 对要部署的项目,右击—>Run As —>Maven clean,结果如下:

[INFO] Scanning for projects...
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]                                                                        
[INFO] ------------------------------------------------------------------------
[INFO] Building demo 1.0.1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.6.1:clean (default-clean) @ demo ---
[INFO] Deleting F:\lee\springboot_demo\demo\target
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.781 s
[INFO] Finished at: 2018-08-15T16:16:57+08:00
[INFO] Final Memory: 6M/155M
[INFO] ------------------------------------------------------------------------

1.2 选中要部署的项目 右击 —> Run As —> Maven install,结果如下:

Results :
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] --- maven-jar-plugin:2.6:jar (default-jar) @ demo ---
[INFO] Building jar: F:\lee\springboot_demo\demo\target\demo-1.0.1.jar
[INFO]
[INFO] --- spring-boot-maven-plugin:1.5.14.BUILD-SNAPSHOT:repackage (default) @ demo ---
[INFO]
[INFO] --- maven-install-plugin:2.5.2:install (default-install) @ demo ---
[INFO] Installing F:\lee\springboot_demo\demo\target\demo-1.0.1.jar to D:\devtools\newRepository\com\example\demo\1.0.1\demo-1.0.1.jar
[INFO] Installing F:\lee\springboot_demo\demo\pom.xml to D:\devtools\newRepository\com\example\demo\1.0.1\demo-1.0.1.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 18.605 s
[INFO] Finished at: 2018-08-15T16:25:41+08:00
[INFO] Final Memory: 38M/292M
[INFO] ------------------------------------------------------------------------

二. 上传jar包到服务区

2.1 使用Xftp上传还活着使用命令上传

三. 启动jar包

3.1 首先查看该端口下的进程

netstat -lanp|grep 端口号

3.2 杀掉该进程

kill -9 进程号

3.3 启动jar包

 nohup java -jar demo-1.0.1.jar >springboot.log 2>&1 &

3.4 查看日志

tail -f springboot.log

3.5 在浏览器地址栏输入项目地址,访问项目检查是否部署成功

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值