欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

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

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

限制條件:

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,其他平臺(tái)需要定制腳本

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下查看文件格式為一個(gè)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

文件開(kāi)頭:

image

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

image

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

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

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

總結(jié)

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

相關(guān)文章

最新評(píng)論