亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

Spring boot部署發(fā)布到linux的操作方法

 更新時間:2017年05月10日 08:48:20   作者:小小她  
這篇文章主要介紹了Spring boot部署發(fā)布到linux的操作方法,非常不錯,具有參考借鑒價值,需要的朋友可以參考下

限制條件:

The default script supports most Linux distributions and is tested on CentOS and Ubuntu. Other platforms, such as OS X and FreeBSD, will require the use of a custom embeddedLaunchScript.

當(dāng)前文檔適用于 CentOS and Ubuntu,其他平臺需要定制腳本

1、部署發(fā)布

1.1 打包

maven打包成執(zhí)行文件

<plugin>
 <groupId>org.springframework.boot</groupId>
 <artifactId>spring-boot-maven-plugin</artifactId>
 <configuration>
  <executable>true</executable>
 </configuration>
</plugin> 

Gradle設(shè)置

springBoot {
 executable = true
} 

You can then run your application by typing ./my-application.jar (where my-application is the name of your artifact).

打包完成后,可以使用./my-application.jar 運(yùn)行 

1.2 原理

linux下查看文件格式為一個bshell可執(zhí)行文件

[root@i-2cjt6k6n ~]# file audit-console-1.0.0.jar
audit-console-1.0.0.jar: Bourne-Again shell script text executable 

查看文件內(nèi)容

vi audit-console-1.0.0.jar

文件開頭:

image

shell與執(zhí)行jar內(nèi)容的分割:

image

可以看到,非常高的技巧,jar包包裝為shell可執(zhí)行文件,另外可以加載自己運(yùn)行 

1.3 發(fā)布為一個服務(wù)

 ln -s /var/myapp/myapp.jar /etc/init.d/myapp
service myapp start

總結(jié)

以上所述是小編給大家介紹的Spring boot部署發(fā)布到linux的操作方法,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復(fù)大家的。在此也非常感謝大家對腳本之家網(wǎng)站的支持!

相關(guān)文章

最新評論