Version 4.0.0
Version 4.0.0 is finally there and includes various bug-fixes, improvements and some changes that can be considered as potential breaking changes :-)
The main key-aspects that have been improved or being worked on are the following:
Potential breaking changes:
- initial effort for modularisation (mainly splitting the project into a
maven
and acore
-project) -- #441 (initial idea #228) runOnlyOnce
coupled with Maven's--projects
parameter makes plugin not run at all -- #387, #443
New Features / Bug-Fixes:
- make
injectAllReactorProjects
slightly less verbose -- #431 - allow to override
useNativeGit
from command line via-Dmaven.gitcommitid.nativegit=true
-- #433 - add support for
git.branch
andgit.build.number
for Azure DevOps -- #439 - add support for
git.branch
andgit.build.number
for CircleCI -- #449 - use maven's PluginParameterExpressionEvaluator to allow replacements with values that contain unresolved variables. E.g. allows to specify the
git.branch
in sonar's project version:
<replacementProperties>
<replacementProperty>
<property>sonar.projectVersion</property>
<token>^.*$</token>
<value>${project.version}-${git.branch}</value>
<regex>false</regex>
</replacementProperty>
</replacementProperties>
See #444 for further details.
- update dependencies -- #437, #451
- added tests for java 8, java 9, java 10, java 11, java 12 and java 13.
Getting the latest release
The plugin is available from Maven Central (see here), so you don't have to configure any additional repositories to use this plugin. All you need to do is to configure it inside your project as dependency:
<dependency>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<version>4.0.0</version>
</dependency>
Getting the latest snapshot (build automatically)
If you can't wait for the next release, you can also get the latest snapshot version from sonatype, that is being deployed automatically by travis:
<pluginRepositories>
<pluginRepository>
<id>sonatype-snapshots</id>
<name>Sonatype Snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</pluginRepository>
</pluginRepositories>
Even though travis will only deploy a new snapshot once all tests have finished, it is recommended to rely on the released and more stable version.
Known Issues / Limitations:
- This plugin is unfortunately not working with Heroku which is due to the fact how Heroku works. In summary Heroku does not copy over the .git-repository but in order to determine the git properties this plugin relies on the fact that it has access to the git-repository. A somewhat workaround to get some information is outlined in #279 (comment)
- Using maven's plugin prefix resolution (e.g.
mvn com.test.plugins:myPlugin:myMojo
) might result in unresolved properties even with<injectAllReactorProjects>true</injectAllReactorProjects>
. Please refer to #287 or #413 (comment) for details and potential workarounds - For some (undetermined) reason the plugin might fail with
org.eclipse.jgit.api.errors.TransportException: USERAUTH fail
under java 13 (I can't reproduce the issue), however a workaround would be specifying<offline>true</offline>
or using the native git implementation with<useNativeGit>true</useNativeGit>
.
Reporting Problems
If you find any problem with this plugin, feel free to report it here