[英]Problems with maven release on git
I've got a very strange problem: Every time I want to release my open source project (hosted on github) maven is uploading a snapshot to my repository instead of the expected release. 我有一个非常奇怪的问题:每次我要发布我的开源项目(托管在github上)时,maven都会将快照上传到我的存储库中,而不是预期的发布中。
I've found out, the problem is that the pom of the release tag (git) contains a snapshot version. 我发现,问题在于发布标记(git)的pom包含快照版本。 It seems means release:prepare doesn't set the correct release version for the release tag. 似乎意味着release:prepare没有为release标签设置正确的发行版本。
I'm using maven 3.2.3 and git 2.0.1. 我正在使用Maven 3.2.3和git 2.0.1。
The pom.xml here . 这里的pom.xml。
Every hint is welcome. 任何提示都是值得欢迎的。
I think it is because of https://jira.codehaus.org/browse/MRELEASE-812 . 我认为是因为https://jira.codehaus.org/browse/MRELEASE-812 。
It should be fixed in 2.5. 它应该固定在2.5中。 However see the comment 但是请参阅评论
I used this plugin configuration 我使用了此插件配置
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.scm</groupId>
<artifactId>maven-scm-provider-gitexe</artifactId>
<version>1.9.2</version>
</dependency>
<dependency>
<groupId>org.apache.maven.scm</groupId>
<artifactId>maven-scm-api</artifactId>
<version>1.9.1</version>
</dependency>
</dependencies>
</plugin>
and it works for me. 它对我有用。
PS: Use mvn release:prepare -DpushChanges=false
when you test the plugin. PS:在测试插件时,请使用mvn release:prepare -DpushChanges=false
。 The changes are only local than and you can reset them. 更改仅是本地更改,您可以重置它们。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.