一、假設有四個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
>
<
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)
