限制條件:
創(chuàng)新互聯(lián)公司作為成都網(wǎng)站建設(shè)公司,專注成都網(wǎng)站建設(shè)、網(wǎng)站設(shè)計(jì),有關(guān)成都企業(yè)網(wǎng)站定制方案、改版、費(fèi)用等問題,行業(yè)涉及成都砂巖浮雕等多個領(lǐng)域,已為上千家企業(yè)服務(wù),得到了客戶的尊重與認(rèn)可。
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
文件開頭:
shell與執(zhí)行jar內(nèi)容的分割:
可以看到,非常高的技巧,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ù)大家的。在此也非常感謝大家對創(chuàng)新互聯(lián)網(wǎng)站的支持!
網(wǎng)頁題目:Springboot部署發(fā)布到linux的操作方法
URL地址:http://www.rwnh.cn/article46/jsdjhg.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站設(shè)計(jì)、外貿(mào)建站、搜索引擎優(yōu)化、云服務(wù)器、全網(wǎng)營銷推廣、營銷型網(wǎng)站建設(shè)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)