git-commit-id-maven-plugin icon indicating copy to clipboard operation
git-commit-id-maven-plugin copied to clipboard

Commit hash is not correct when used with maven-release-plugin

Open salyh opened this issue 10 years ago • 4 comments

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]

salyh avatar Jan 13 '16 10:01 salyh

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

ktoso avatar Mar 26 '16 18:03 ktoso

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.

damnhandy avatar Mar 27 '16 15:03 damnhandy

Thanks a lot for the help!

ktoso avatar Mar 27 '16 16:03 ktoso

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 calls releaseManager.prepare

  • mvn release:perform -> docs: https://maven.apache.org/maven-release/maven-release-plugin/perform-mojo.html#goals -> default seems value is either deploy or deploy site-deploy -> basically calls releaseManager.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

TheSnoozer avatar Sep 20 '17 02:09 TheSnoozer