Maven plugin which includes build-time git repository information into an POJO / *.properties). Make your apps tell you which version exactly they were built from! Priceless in large distributed deployments... :-)
LGPL-3.0 License
Bot releases are hidden (Show)
Published by TheSnoozer about 6 years ago
Version 2.2.5 is finally there and includes various bug-fixes and improvements :-)
The main key-aspects that have been improved or being worked on are the following:
git.build.number
and git.build.number.unique
) for Bamboo, Hudson, Jenkins, TeamCity, Travis, Gitlab CI - https://github.com/ktoso/maven-git-commit-id-plugin/issues/353 / https://github.com/ktoso/maven-git-commit-id-plugin/pull/369
git.branch
support for GitlabCI - https://github.com/ktoso/maven-git-commit-id-plugin/pull/368
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.5</version>
</dependency>
If you find any problem with this plugin, feel free to report it here
Published by TheSnoozer almost 7 years ago
Version 2.2.4 is finally there and includes various bug-fixes and improvements :-)
The main key-aspects that have been improved or being worked on are the following:
-Dmaven.gitcommitid.skip=true
does not skip the plugin execution when the configuration in the POM includes a <skip>false</skip>
- https://github.com/ktoso/maven-git-commit-id-plugin/issues/315
transformationRules
for the property where those rules should take effect. Each transformationRule
consist of two required fields apply
and action
. The apply
-tag controls when the rule should be applied and can be set to BEFORE
to have the rule being applied before or it can be set to AFTER
to have the rule being applied after the replacement. The action
-tag determines the string conversion rule that should be applied. Currenlty supported is LOWER_CASE
and UPPER_CASE
. Potential candidates in the feature are CAPITALIZATION
and INVERT_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 https://github.com/ktoso/maven-git-commit-id-plugin/issues/317 for more details on a use-case.
mvn clean verify -Pcheckstyle -Dmaven.test.skip=true -B
for java 7 and java 8. For java9 one may want to run mvn 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. git.closest.tag.name
and git.closest.tag.count
now will be determined based on properties configured inside the git-describe command (https://github.com/ktoso/maven-git-commit-id-plugin/issues/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
git.tags
property (basically it wasn't reporting all tags of a given commit) - https://github.com/ktoso/maven-git-commit-id-plugin/issues/339
HEAD
which should reference to the latest commit in your repository. In general this property can be set to something generic like HEAD^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.<evaluateOnCommit>HEAD</evaluateOnCommit>
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>
If you find any problem with this plugin, feel free to report it here
Published by TheSnoozer about 7 years ago
Version 2.1.10 is finally there and includes various bug-fixes and improvements :-)
<useNativeGit>true/false</useNativeGit>
option to choose whether to run with the original jgit implementation or to perform calls to the native git-binary. By default the plugin uses the jgit java implementation (<useNativeGit>false</useNativeGit>
) and as a general thumb rule the native git binary should only be used if you experience any strange performance issues (e.g. git data extraction takes several minutes) or any other problems that might not be limited to git shallow clones. (https://github.com/ktoso/maven-git-commit-id-plugin/pull/120, https://github.com/ktoso/maven-git-commit-id-plugin/issues/119, https://github.com/ktoso/maven-git-commit-id-plugin/pull/118, https://github.com/ktoso/maven-git-commit-id-plugin/issues/110, https://github.com/ktoso/maven-git-commit-id-plugin/pull/93)git.commit.id.short-describe
that strips out commit hash and gives more (non-tech-) user friendly build number (e.g. instead of 1.2.0-123-gd3a890
it will give 1.2.0-123
) - https://github.com/ktoso/maven-git-commit-id-plugin/pull/111
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.1.10</version>
</dependency>
If you find any problem with this plugin, feel free to report it here
Published by TheSnoozer about 7 years ago
Version 2.1.11 is finally there and includes various bug-fixes and improvements :-)
<generateGitPropertiesFilename>
is used - https://github.com/ktoso/maven-git-commit-id-plugin/issues/124
git.properties
file - currently defaults to UTF-8
- https://github.com/ktoso/maven-git-commit-id-plugin/pull/131
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.1.11</version>
</dependency>
If you find any problem with this plugin, feel free to report it here
Published by TheSnoozer about 7 years ago
Version 2.1.12 is finally there and includes various bug-fixes and improvements :-)
<runOnlyOnce>false</runOnlyOnce>
- https://github.com/ktoso/maven-git-commit-id-plugin/issues/53
--match
option for describe - https://github.com/ktoso/maven-git-commit-id-plugin/issues/97
runGitDescribeWithMatchOption
had trouble on Travis - https://github.com/ktoso/maven-git-commit-id-plugin/issues/146
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.1.12</version>
</dependency>
If you find any problem with this plugin, feel free to report it here
Published by TheSnoozer about 7 years ago
Version 2.1.13 is finally there and includes various bug-fixes and improvements :-)
-dirty
as default dirty-marker for git describe - https://github.com/ktoso/maven-git-commit-id-plugin/issues/149
buildDate
which then caused eclipse to detect a changed file and going into an endless cylce - https://github.com/ktoso/maven-git-commit-id-plugin/issues/151
true
and will now be set to false
.true
(e.g. <injectAllReactorProjects>true</injectAllReactorProjects>
)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.1.13</version>
</dependency>
If you find any problem with this plugin, feel free to report it here
Published by TheSnoozer about 7 years ago
Version 2.1.14 is finally there and includes various bug-fixes and improvements :-)
This project is currently maintained thanks to: @ktoso (founder), @TheSnoozer
git.build.host
as new property - https://github.com/ktoso/maven-git-commit-id-plugin/pull/178
includeOnlyProperties
which can be used to include only certain properties into the resulting file. Please note that this configuration will be overruled by the exclude properties - https://github.com/ktoso/maven-git-commit-id-plugin/pull/192
build.version
as new property - https://github.com/ktoso/maven-git-commit-id-plugin/pull/192
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.1.14</version>
</dependency>
If you find any problem with this plugin, feel free to report it here
Published by TheSnoozer about 7 years ago
Version 2.1.15 is finally there and includes various bug-fixes and improvements :-)
The main key-aspects that have been improved or being worked on are the following:
git.closest.tag.name
and git.closest.tag.commit.count
as additional output - https://github.com/ktoso/maven-git-commit-id-plugin/issues/54
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.1.15</version>
</dependency>
If you find any problem with this plugin, feel free to report it here
Published by TheSnoozer about 7 years ago
Version 2.2.0 is finally there and includes various bug-fixes and improvements :-)
The main key-aspects that have been improved or being worked on are the following:
<dateFormatTimeZone>${user.timezone}</dateFormatTimeZone>
- https://github.com/ktoso/maven-git-commit-id-plugin/issues/204
${project.build.outputDirectory}/git.properties
) - https://github.com/ktoso/maven-git-commit-id-plugin/issues/217
commit.id
and commit.id.abbrev
. However those can not be put into a JSON structure (https://github.com/ktoso/maven-git-commit-id-plugin/issues/122). If you want to populate values into a JSON structure I would recommend to checkout the new switch <commitIdGenerationMode>full</commitIdGenerationMode>
which will store the commit.id
as git.commit.id.full
and thus allowing you to populate the values into a JSON structure. By default this switch is turned off and thus will generate the properties the old fashioned way to ensure backwards compatibility.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.0</version>
</dependency>
If you find any problem with this plugin, feel free to report it here
Published by TheSnoozer about 7 years ago
Version 2.2.1 is finally there and includes various bug-fixes and improvements :-)
The main key-aspects that have been improved or being worked on are the following:
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.1</version>
</dependency>
If you find any problem with this plugin, feel free to report it here
Published by TheSnoozer about 7 years ago
Version 2.2.2 is finally there and includes various bug-fixes and improvements :-)
The main key-aspects that have been improved or being worked on are the following:
-SNAPSHOT
or git repository is dirty
) - https://github.com/ktoso/maven-git-commit-id-plugin/issues/106
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<version>2.2.2</version>
<!-- optional to change the phases of the individual mojo's -->
<executions>
<execution>
<id>get-the-git-infos</id>
<goals>
<goal>revision</goal>
</goals>
</execution>
<execution>
<id>validate-the-git-infos</id>
<goals>
<goal>validateRevision</goal>
</goals>
<!-- default phase is validate -->
<phase>package</phase>
</execution>
</executions>
<configuration>
<validationProperties>
<validationProperty>
<value>${project.version}</value>
<regex>^\Q${git.commit.id.describe}\E$|.*-SNAPSHOT$</regex>
</validationProperty>
<validationProperty>
<value>${git.dirty}</value>
<regex>false</regex>
</validationProperty>
<failIfNoMatch>true</failIfNoMatch>
</validationProperties>
</configuration>
</plugin>
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.2</version>
</dependency>
If you find any problem with this plugin, feel free to report it here
Published by TheSnoozer about 7 years ago
Version 2.2.3 is finally there and includes various bug-fixes and improvements :-)
The main key-aspects that have been improved or being worked on are the following:
-Dmaven.gitcommitid.skip=true
- https://github.com/ktoso/maven-git-commit-id-plugin/issues/268
runOnIncremental=false
- https://github.com/ktoso/maven-git-commit-id-plugin/issues/269
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.3</version>
</dependency>
If you find any problem with this plugin, feel free to report it here
Published by ktoso over 10 years ago
Version 2.1.9 is finally there and includes various bug-fixes and improvements :-)
Allows to filter which properties you want to expose (for example you might want to hide repo url, or email).
Main feature: https://github.com/ktoso/maven-git-commit-id-plugin/commit/7c2bea0cac8e645af9a4bb0e4271170140df5738 resolves issue https://github.com/ktoso/maven-git-commit-id-plugin/issues/91
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.1.9</version>
</dependency>
If you find any problem with this plugin, feel free to report it here