java需要編譯的,打包后文件要上傳到服務(wù)器。推薦二個(gè)辦法,

創(chuàng)新互聯(lián)憑借專業(yè)的設(shè)計(jì)團(tuán)隊(duì)扎實(shí)的技術(shù)支持、優(yōu)質(zhì)高效的服務(wù)意識(shí)和豐厚的資源優(yōu)勢(shì),提供專業(yè)的網(wǎng)站策劃、網(wǎng)站制作、成都網(wǎng)站建設(shè)、網(wǎng)站優(yōu)化、軟件開發(fā)、網(wǎng)站改版等服務(wù),在成都十載的網(wǎng)站建設(shè)設(shè)計(jì)經(jīng)驗(yàn),為成都近千家中小型企業(yè)策劃設(shè)計(jì)了網(wǎng)站。
第一種,用jenkins,可以使用centos7 jenkins 發(fā)布vue ssr,編譯類的語言都可能過jenkins來發(fā)布,.net沒試過。
第二種,用wagon包來實(shí)現(xiàn)
1,修改pom.xml
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>wagon-maven-plugin</artifactId>
<version>1.0</version>
<configuration>
<serverId>${profiles.active}</serverId>
<fromFile>target/test.jar</fromFile>
<url>scp://root@${profiles.url}/var/www/java/target</url>
</configuration>
</plugin>
</plugins>
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh</artifactId>
<version>2.8</version>
</extension>
</extensions>
</build>
<profiles>
<profile>
<!-- staging -->
<id>nlj-staging</id>
<properties>
<profiles.active>nlj-staging</profiles.active>
<profiles.resource>staging</profiles.resource>
<profiles.url>10.0.0.12</profiles.url> <profiles.updatePolicy>always</profiles.updatePolicy </properties>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
<profile>
<id>nlj-bms-prod</id>
<properties>
<profiles.active>nlj-bms-prod</profiles.active> <profiles.resource>production</profiles.resource>
<profiles.url>47.111.11.11</profiles.url> <profiles.updatePolicy>always</profiles.updatePolicy>
</properties>
</profile>
</profiles> 配置完,重新加載maven包。
2,打包,并上傳
# mvn clean package -Pnlj-staging -Dmaven.test.skip=true # mvn wagon:upload-single -Pnlj-staging 。。。。。。。。。。。。。。省略。。。。。。。。。。。。。。 [INFO] --- wagon-maven-plugin:1.0:upload-single (default-cli) @ test --- Password for root@10.0.0.12: ******* [INFO] Uploading: /Users/zhangying/Documents/www/target/test.jar scp://10.0.0.12/var/www/java/target/test.jar [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 40.392 s [INFO] Finished at: 2019-03-29T18:48:07+08:00 [INFO] Final Memory: 14M/176M [INFO] ------------------------------------------------------------------------
以上就是本文的全部內(nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持創(chuàng)新互聯(lián)。
新聞名稱:javawagon如何打包文件到不同服務(wù)器
URL網(wǎng)址:http://www.chinadenli.net/article6/ispiog.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供微信小程序、虛擬主機(jī)、營銷型網(wǎng)站建設(shè)、網(wǎng)站導(dǎo)航、定制網(wǎng)站、網(wǎng)站設(shè)計(jì)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)