Jenkins_多項目構建(二):使用Maven聚集關系


 
 
一、假設有四個Maven項目
1、soa-dub-parent:父項目
1
2
3
4
5
< modules >
         < module >../soa-dub-facade</ module >
         < module >../soa-dub-service</ module >
     </ modules >

3、soa-dub-facade:服務接口項目

 

1
2
3
4
5
6
< parent >
         < artifactId >soa-dub-parent</ artifactId >
         < groupId >com.cn</ groupId >
         < version >0.0.1-SNAPSHOT</ version >
         < relativePath >../soa-dub-parent/pom.xml</ relativePath >
     </ parent >
4、 soa-dub-service :服務實現項目
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
< parent >
       < artifactId >soa-dub-parent</ artifactId >
       < groupId >com.cn</ groupId >
       < version >0.0.1-SNAPSHOT</ version >
       < relativePath >../soa-dub-parent/pom.xml</ relativePath >
   </ parent >
   < modelVersion >4.0.0</ modelVersion >
 
   < artifactId >soa-dub-service</ artifactId >
   < packaging >jar</ packaging >
 
   < name >soa-dub-service</ name >
   < url >http://maven.apache.org</ url >
 
   < dependencies >
       < dependency >
           < groupId >com.cn</ groupId >
           < artifactId >soa-dub-facade</ artifactId >
           < version >0.0.1-SNAPSHOT</ version >
       </ dependency >
   </ dependencies >
需求:構建Maven_Service項目時先構建其它項目
 
 
二、Jenkins操作步驟:
1、創建一個Maven的Job
2、Subversion指向所有項目的根地址
3、Build的Root Pom指向 soa-dub-parent 的pom.xml(注意路徑)
4、注意文件的相對路徑

 

 

三、執行邏輯

soa-dub-parent的pom.xml執行clean install命令,soa-dub-parent會根據module依次clean install子模塊(soa-dub-facade,soa-dub-service)

 






免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM