maven release:prepare fails to release pom.xml with patch version
I am not sure if I am doing something wrong here, or if there is a bug in maven-release-plugin. But when I try to release a version 1.2.1, maven creates a tag with the right version, but the version number set in the tag's pom.xml is set at 1.2 (not 1.2.1 as it should).
This is what I do when I tried to fix a bug in 1.2:
- svn cp URL/tags/myapp-1.2 URL/branches/myapp-1.2
- edit project.version in URL/branches/myapp-1.2/pom.xml to be 1.2.1-SNAPSHOT (was 1.2)
- fix the bug in the source
- commit changes
- mvn release:prepare
- #when asked, use the defaults: release version 1.2.1, next dev version 1.2.2-SNAPSHOT
- [INFO] BUILD SUCCESSFUL
OK so far, but if I check out the code in the new tag the version is wrong! URL/tags/myapp-1.2.1/pom.xml has version 1.2, not 1.2.1 as the tag name should suggest. If I just run mvn release:perform now, the new uploaded jar will have its name set to myapp-1.2.jar, overwriting the original in the repository.
I have upped the maven-release-plugin version from 2.0 to 2.1, but with no greater success. I know the thing that causes this error is the part of the process wher开发者_StackOverflowe the plugin does this:
svn --non-interactive copy --file /tmp/maven-scm-2371633.commit --revision 19866 URL/tags/myapp-1.2 URL/tags/myapp-1.2.1
This copies the source from tags/myapp-1.2 to tags/myapp-1.2.1, but this does not contain any changes. Do you agree that it should have copied from branches/myapp-1.2, not the tag?
Is this working for anyone else, and do you see if I am doing anything wrong?
You need to verify if the repository link in your pom is pointing to a branch instead of the trunk.
If that is the case, then you'll get the error. Point it to the trunk, instead.
精彩评论