使用maven发布插件更新版本
我将maven 3.0.4与cvs和jenkins结合使用 我有一个多模块项目,有一个主pom和一些模块 为了获得正确的版本控制,我在jenkins中设置了一些环境变量 第一步是我在jenkins中有一个预构建步骤,执行maven目标:使用maven发布插件更新版本,maven,jenkins,maven-release-plugin,Maven,Jenkins,Maven Release Plugin,我将maven 3.0.4与cvs和jenkins结合使用 我有一个多模块项目,有一个主pom和一些模块 为了获得正确的版本控制,我在jenkins中设置了一些环境变量 第一步是我在jenkins中有一个预构建步骤,执行maven目标: --batch-mode release:update-versions -DdevelopmentVersion=${ACTUAL_VERSION}${BUILD_NUMBER}-SNAPSHOT 现在maven正在更新我的父pom的版本以及从模块到父pom
--batch-mode release:update-versions -DdevelopmentVersion=${ACTUAL_VERSION}${BUILD_NUMBER}-SNAPSHOT
现在maven正在更新我的父pom的版本以及从模块到父pom的连接。这一切都很好,但我有一些模块之间的内部依赖关系,没有更新。我怎样才能强迫maven也更新它们
例如:
--母公司
--模块1
--模块2
在模块2中,存在对模块1的依赖性,例如
<dependency>
<groupId>xyz</groupId>
<artifactId>module2</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
xyz
模2
0.0.1-快照
发布后:更新版本更新父pom和模块,但依赖项现在仍然引用旧版本。有没有办法更新此依赖项版本?最简单、最好的解决方案(在我看来)是使用:
<dependency>
<groupId>xyz</groupId>
<artifactId>module2</artifactId>
<version>${project.version}</version>
</dependency>
xyz
模2
${project.version}
而不是硬编码版本。可能您也可以使用以下选项:
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>module2</artifactId>
<version>${project.version}</version>
</dependency>
${project.groupId}
模2
${project.version}
在我看来,最简单、最好的解决方案是:
<dependency>
<groupId>xyz</groupId>
<artifactId>module2</artifactId>
<version>${project.version}</version>
</dependency>
xyz
模2
${project.version}
而不是硬编码版本。可能您也可以使用以下选项:
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>module2</artifactId>
<version>${project.version}</version>
</dependency>
${project.groupId}
模2
${project.version}