Commit hash is not correct when used with maven-release-plugin
maven-git-commit-id-plugin (2.2.0) determine wrong commit (548df55) when used with maven-release-plugin. It should point to 6e8a477.
[maven-release-plugin] prepare for next development iteration Commit: 548df55e32bea673970071bf57b21b9e763e5208 [548df55] [maven-release-plugin] prepare release v0.0.26 Commit: 6e8a477e3a35cf7d7fbd55ec602587e1fb18195d [6e8a477]
I fear this may be simply because "during which phase the plugin is run"... If you'd be able to investigate in which phase we'd be able to get the right id, if possible, that'd be awesome I currently do not have the time to research that
I'll dig into this @ktoso since after #240, it clear that the release plugin is doing some weird stuff. It seems to be temporally mucking with the git metadata during the prepare and release process. This bothers me. The maven-git-commit-id-plugin is simply reading the metadata that is available to the git repo. With #240, it was changing the origin URI to include credentials. I would not be surprised to see it doing something else. I'll post back when I find more.
Thanks a lot for the help!
I would consider the following the most common way to perform a release:
-
mvn release:prepare-> docs: https://maven.apache.org/maven-release/maven-release-plugin/prepare-mojo.html#preparationGoals -> default seems:clean verify-> basically callsreleaseManager.prepare -
mvn release:perform-> docs: https://maven.apache.org/maven-release/maven-release-plugin/perform-mojo.html#goals -> default seems value is eitherdeployordeploy site-deploy-> basically callsreleaseManager.perform
general guide / docs: http://central.sonatype.org/pages/ossrh-guide.html
source code
https://maven.apache.org/maven-release/maven-release-plugin/source-repository.html
svn checkout http://svn.apache.org/repos/asf/maven/release/tags/maven-release-2.5.3/maven-release-plugin maven-release-plugin
all interesting mojo's reference the maven-release-manager version 2.5.3
https://maven.apache.org/maven-release/maven-release-manager/source-repository.html
svn checkout http://svn.apache.org/repos/asf/maven/release/tags/maven-release-2.5.3/maven-release-manager maven-release-manager