Version 2.2.4
Version 2.2.4 is finally there and includes various bug-fixes and improvements :-)
New Features / Bug-Fixes:
The main key-aspects that have been improved or being worked on are the following:
- Fixing an issue where
-Dmaven.gitcommitid.skip=true
does not skip the plugin execution when the configuration in the POM includes a<skip>false</skip>
- #315 - Support for all Maven 3.X versions - #316
- The runningOnBuildServer check for detecting the branch name on Jenkins / Hudson is now using 'HUDSON_HOME' and 'JENKINS_HOME' as well - #326
- The in-built replacement of properties (only for properties generated by the plugin) now can also change the casing of the properties that the user wants to replace (e.g. lower case VS upper case). This behaviour can be achieved by defining a list of
transformationRules
for the property where those rules should take effect. EachtransformationRule
consist of two required fieldsapply
andaction
. Theapply
-tag controls when the rule should be applied and can be set toBEFORE
to have the rule being applied before or it can be set toAFTER
to have the rule being applied after the replacement. Theaction
-tag determines the string conversion rule that should be applied. Currenlty supported isLOWER_CASE
andUPPER_CASE
. Potential candidates in the feature areCAPITALIZATION
andINVERT_CASE
(open a ticket if you need them...).
<replacementProperties>
<!-- example: apply replacement only to the specific property git.branch and replace '/' with '-' -->
<replacementProperty>
<property>git.branch</property>
<!-- will not overwrite the existing property and generate a new `git.branch.something` -->
<propertyOutputSuffix>something</propertyOutputSuffix>
<token>^([^\/]*)\/([^\/]*)$</token>
<value>$1-$2</value>
<regex>true</regex>
<transformationRules>
<transformationRule>
<apply>BEFORE</apply>
<action>UPPER_CASE</action>
</transformationRule>
<transformationRule>
<apply>AFTER</apply>
<action>LOWER_CASE</action>
</transformationRule>
</transformationRules>
</replacementProperty>
</replacementProperties>
See #317 for more details on a use-case.
- Release-Notes (available as RSS-Feed https://github.com/ktoso/maven-git-commit-id-plugin/releases.atom) - #324 :-)
- The code style access this project will now be verified with checkstyle rules (initial idea #214). A contributer can verify the code style either by installing the codestyle plugin in his IDE or simply run checkstyle via maven and execute
mvn clean verify -Pcheckstyle -Dmaven.test.skip=true -B
for java 7 and java 8. For java9 one may want to runmvn clean verify -Pcheckstyle -Dcheckstyle.version=8.2 -Dmaven.test.skip=true -B
that uses a more recent checkstyle version. Feel free to check out our FAQ-Section in the Readme that contains a small write up on how you can integrate checkstyle into your IDE. - The output properties
git.closest.tag.name
andgit.closest.tag.count
now will be determined based on properties configured inside the git-describe command (#221). Example:
<gitDescribe>
<tags>true</tags>
</gitDescribe>
will cause that lightweight tags are also included for the closest tags
Also the pattern
used inside the gitDescribe might have an impact on the resulting git.closest.tag.name
and git.closest.tag.count
- this project now has an Issue Template that is being used for every new issue by default - #337
- Under certain conditions the JGit implementation yielded wrong results inside the exposed
git.tags
property (basically it wasn't reporting all tags of a given commit) - #339 - A new option to allow to tell the plugin what commit should be used as reference to generate the properties from (#338). By default this property is simply set to
HEAD
which should reference to the latest commit in your repository. In general this property can be set to something generic likeHEAD^1
or point to a branch or tag-name. To support any kind or use-case this configuration can also be set to an entire commit-hash or it's abbreviated version. Please note that for security purposes not all references might be allowed as configuration.
The configuration can be used in the following:
<evaluateOnCommit>HEAD</evaluateOnCommit>
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>2.2.4</version>
</dependency>
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)
Reporting Problems
If you find any problem with this plugin, feel free to report it here