小编Mou*_*Das的帖子

pom.xml 中的版本属性动态

我有一个 Maven pom.xml,我使用 Jenkins 在 Nexus 中构建项目和可执行 jar 部署。但我想根据分支名称更改版本名称。

例如:我在 pom.xml 中有

<groupId>net.test</groupId>
<artifactId>test-parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>iin-parent</name>
<packaging>pom</packaging>
Run Code Online (Sandbox Code Playgroud)

我需要这样设置:(分支-Master/Test1/Test2/..)

<groupId>net.test</groupId>
<artifactId>test-parent</artifactId>
<version>BranchName_0.0.1-SNAPSHOT</version>
<name>iin-parent</name>
<packaging>pom</packaging>
Run Code Online (Sandbox Code Playgroud)

如何才能做到这一点?

我正在使用 MVN 构建,如 -Drevision=BranchName-SNAPSHOT clean 编译包部署。但我想动态获取分支名称。

enter code here
Run Code Online (Sandbox Code Playgroud)

github nexus pom.xml maven jenkins

5
推荐指数
1
解决办法
1万
查看次数

标签 统计

github ×1

jenkins ×1

maven ×1

nexus ×1

pom.xml ×1