【发布时间】:2020-05-30 07:05:02
【问题描述】:
我有一个 maven 项目,我确实从用户那里获得了新的项目版本:
Current Version = 1.0.0
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>2.7</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>set</goal>
</goals>
</execution>
</executions>
</plugin>
Current Version = 2.0.0
然后我调用了我自己的自定义插件,它运行一组计算并将一个字符串附加到版本
Current Version = 2.0.0
<groupId>mygroup</groupId>
<artifactId>my artifact</artifactId>
<version>1.0.0</version>
<executions>
<execution>
<phase>process-sources</phase>
<goals>
<goal>validate</goal>
</goals>
</execution>
</executions>
Current Version = 2.0.0-AddedString
但是当我运行其他插件时,例如:
<groupId>com.github.ekryd.echo-maven-plugin</groupId>
<artifactId>echo-maven-plugin</artifactId>
<executions>
<execution>
<id>end</id>
<goals>
<goal>echo</goal>
</goals>
<phase>process-resources</phase>
<configuration>
<message>${project.version}</message>
</configuration>
</execution>
</executions>
这给了我结果:“1.0.0”应该是“2.0.0-AddedString”
但是为什么呢? 以及如何解决这个问题?我需要所有插件都使用新版本并使用它。
【问题讨论】:
标签: java maven pom.xml maven-plugin versioning