Maven Release Plugin - prepare 创建快照版本的标签而不是发布版本 [英] Maven Release Plugin - prepare creates tag of Snapshot version instead of release version
问题描述
我有以下项目结构:
- 框架
- framework-parent-pom
- 框架类
- ...
在framework-parent-pom的pom.xml中,我定义了以下插件:
In the pom.xml of framework-parent-pom I have defined following plugin:
<plugin> <artifactId>maven-release-plugin</artifactId> <version>2.3.2</version> <configuration> <branchBase>http://.../svn/REPO/branches/framework</branchBase> <tagBase>http://.../svn/REPO/tags/releases/framework</tagBase> <tagNameFormat>release-@{project.version}</tagNameFormat> <releaseProfiles>release</releaseProfiles> </configuration> </plugin>
以及以下 SCM:
<scm> <developerConnection>scm:svn:http://.../svn/REPO/trunk/framework/framework-parent-pom</developerConnection> </scm>
当我运行以下命令时...
When I run following command...
mvn release:prepare -DautoVersionSubmodules=true -Darguments="-DskipTests" -Dresume=false
……一切似乎都很顺利.
...everything seems to go well.
在本地创建了带有发布版本的 JAR,并且 POM 很好地更新到下一个 SNAPSHOT 版本.同样在 SVN 中,乍一看似乎还可以.标签已创建,其中包含所有框架项目.
Locally the JAR's with the release version were created and the POM's are nicely updated to the next SNAPSHOT version. Also in SVN, at first sight it seems ok. The tag has been created with all the framework projects inside it.
但是,在查看标记的 POM 时,我发现它们仍然具有初始快照版本作为版本.这当然会导致执行步骤构建快照版本而不是发布版本.
However, when looking at the POM's of the tag I see that they still have the initial snapshot version as version. This then of course causes the perform step to build the snapshot version and not the release version.
我做错了什么?
推荐答案
我在 maven-release-plugin 问题跟踪器中找到了解决方法 MRELEASE-812 :
I find the workaround in the maven-release-plugin issue tracker MRELEASE-812 :
就我而言,变化是:
<plugin> <artifactId>maven-release-plugin</artifactId> - <version>2.2.2</version> + <version>2.4.1</version> <configuration> <releaseProfiles>release</releaseProfiles> <goals>install animal-sniffer:check deploy site</goals> </configuration> + <dependencies> + <dependency> + <groupId>org.apache.maven.scm</groupId> + <artifactId>maven-scm-api</artifactId> + <version>1.8.1</version> + </dependency> + <dependency> + <groupId>org.apache.maven.scm</groupId> + <artifactId>maven-scm-provider-gitexe</artifactId> + <version>1.8.1</version> + </dependency> + </dependencies> </plugin>
这篇关于Maven Release Plugin - prepare 创建快照版本的标签而不是发布版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!