- ignore ci/cd environment if head SHA hash is not matching environment variable commit hash
- fix value of describe.tag.version placeholder
- automatically add git version plugin to maven enforcer unCheckedPluginList #171
- Extend gitlab ci support for env var CI_MERGE_REQUEST_SOURCE_BRANCH_NAME #218
- add new placeholders
${describe.tag.version.patch.plus.describe.distance}
${describe.tag.version.patch.next.plus.describe.distance}
${describe.tag.version.label.plus.describe.distance}
${describe.tag.version.label.next.plus.describe.distance}
- new placeholder
${build.timestamp}
maven-build-timestamp (epoch seconds) e.g. '1560694278'${build.timestamp.year}
maven-build-timestamp year e.g. '2021'${build.timestamp.year.2digit}
2-digit maven-build-timestamp year.g. '21'${build.timestamp.month}
maven-build-timestamp month of year e.g. '12'${build.timestamp.day}
maven-build-timestamp day of month e.g. '23'${build.timestamp.hour}
maven-build-timestamp hour of day (24h)e.g. '13'${build.timestamp.minute}
maven-build-timestamp minute of hour e.g. '59'${build.timestamp.second}
maven-build-timestamp second of minute e.g. '30'${build.timestamp.datetime}
maven-build-timestamp formatted asyyyyMMdd.HHmmss
e.g. '20190616.161442'
- add config option for
<projectVersionPattern>
to use special parts of the project version as placeholders e.g.${version.environment}
- add placeholder
${version.core}
the core version component of${version}
e.g. '1.2.3'${version.release}
is marked as deprecated
- handle lightweight tags
- set
${version.minor.next}
placeholders properly
- fix git describe tag selection, if multiple tags point to head
- add missing
${version.label.prefixed}
placeholder
- handle multiline config elements in
maven-git-versioning-extension.xml
- migrate to java 11
- placeholder
- new
${version.major.next}
${version.minor.next}
${version.patch.next}
${describe.tag.version}
${describe.tag.version.major}
${describe.tag.version.major.next}
${describe.tag.version.minor}
${describe.tag.version.minor.next}
${describe.tag.version.path}
${describe.tag.version.patch.next}
- removed
${version.minor.prefixed}
${version.patch.prefixed}
- new
- drop support for java 8
- add additional version component placeholders (#182)
${version.minor.prefixed}
like${version.minor}
with version component separator e.g. '.2'${version.patch.prefixed}
like${version.patch}
with version component separator e.g. '.3'${version.label}
the version label of${version}
e.g. 'SNAPSHOT'${version.label.prefixed}
like${version.label}
with label separator e.g. '-SNAPSHOT'
${version.release}
will remove all version labels instead of just the-SNAPSHOT
label
- add additional version component placeholders (#165 @pdkyas)
- fix worktree handling
- Add
<relatedProjects>
config option
- fix
rootDirectory
determination for sub working trees
- proper handle of concurrent module builds
- if a tag is provided (and no branch) the extension behaves like in detached head state
- if a branch is provided (and no tag) the extension behaves like in attached head state with no tags pointing to head
- New Placeholder
${commit.timestamp.year.2digit}
-
Add GitHub Actions, GitLab CI and Jenkins environment variable support
- GitHub Actions: if
$GITHUB_ACTIONS == true
,GITHUB_REF
is considered - GitLab CI: if
$GITLAB_CI == true
,CI_COMMIT_BRANCH
andCI_COMMIT_TAG
are considered - Circle CI: if
$CIRCLECI == true
,CIRCLE_BRANCH
andCIRCLE_TAG
are considered - Jenkins: if
JENKINS_HOME
is set,BRANCH_NAME
andTAG_NAME
are considered
- GitHub Actions: if
-
Simplify xml configuration (also see BREAKING CHANGES)
Example:
maven-git-versioning-extension.xml
<configuration xmlns="https://github.com/qoomon/maven-git-versioning-extension" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://github.com/qoomon/maven-git-versioning-extension https://qoomon.github.io/maven-git-versioning-extension/configuration-7.0.0.xsd"> <refs> <ref type="branch"> <pattern>.+</pattern> <version>${ref}-SNAPSHOT</version> <properties> <foo>${ref}</foo> </properties> </ref> <ref type="tag"> <pattern><![CDATA[v(?<version>.*)]]></pattern> <version>${ref.version}</version> </ref> </refs> <!-- optional fallback configuration in case of no matching ref configuration--> <rev> <version>${commit}</version> </rev> </configuration>
-
New option to consider tag configs on branches (attached HEAD), enabled by
<refs considerTagsOnBranches="true">
- If enabled, first matching branch or tag config will be used for versioning
-
prevent unnecessary updates of
pom.xml
to prevent unwanted rebuilds (#129 kudos to @ls-urs-keller)
- There is no default config anymore, if no
<ref>
configuration is matching current git situation and no<rev>
configuration has been defined a warning message will be logged and extension will be skipped. - Placeholder Changes (old -> new)
${branch}
->${ref}
${tag}
->${ref}
${REF_PATTERN_GROUP}
->${ref.REF_PATTERN_GROUP}
${describe.TAG_PATTERN_GROUP}
->${describe.tag.TAG_PATTERN_GROUP}
preferTags
option was removed- use
<refs considerTagsOnBranches="true">
instead
- use
- add git describe version placeholders
- new placeholders
${describe}
${describe.tag}
${describe.<TAG_PATTERN_GROUP_NAME or TAG_PATTERN_GROUP_INDEX>}
e.g. patternv(?<version>.*)
will create placeholder${describe.version}
${describe.distance}
- new placeholders
- no longer provide project property
git.dirty
due to performance issues on larger projects, version format placeholder${dirty}
is still available
- Fix parent project version handling
- Handle xsi:schemaLocation property in configuration file
- Improved Logging
- Add support for environment variables in version formats e.g.
${env.BUILD_NUMBER}
- add ability to define default or overwrite values for version and property format.
- default value if parameter value is not set
${paramter:-<DEFAULT_VALUE>}
e.g.${buildNumber:-0}
- overwrite value if parameter has a value
${paramter:+<OVERWRITE_VALUE>}
e.g.${dirty:+-SNAPSHOT}
- default value if parameter value is not set
- fixed wrong dependency management version updates.
- add
${dirty.snapshot}
placeholder that resolves to-SNAPSHOT
if repository is in a dirty state.- e.g.
<versionFormat>${tag}${dirty.snapshot}</versionFormat>
- e.g.
- fixed
NullPointerException
when no<commit>
config tag exists.
- fixed
NullPointerException
when noversionFormat
is set.
- fixed wrong property replacement.
- fixed
NullPointerException
when no<plugin><groupId>
is undefined.
- fixed
NullPointerException
caused by accessing wrong element within versioning ofpom.xml
profile plugin section
- add padding for
timestamp
related placeholder values.
- Major refactoring
- Project
<Dependency>
and<Plugin>
versions will be updated accordingly to git versions - Add config option
<disable>true</disable>
to disable extension by default. - Add format placeholder:
${dirty.snapshot}
${commit.timestamp.year}
${commit.timestamp.month}
${commit.timestamp.day}
${commit.timestamp.hour}
${commit.timestamp.minute}
${commit.timestamp.second}
- Maven CLI properties e.g.
mvn ... -Dfoo=bar
will be accessible by${foo}
placeholder
- default version format on a branch changed to
${branch}-SNAPSHOT
was${commit}
- Removed support for project property
versioning.disable
to disable extension by default, use config option<disable>
instead. - Replace property regex pattern match with simple name match
- old regex pattern config
<branch|tag|commit> <property> <pattern>
- new property name config
<branch|tag|commit> <property> <name>
- old regex pattern config
- Remove property value pattern
<branch|tag|commit> <property> <valuePattern>
- Remove format placeholder
${property.name}
- Rename format placeholder
${property.value}
to just${value}
- Move temporary git versioned
pom.xml
from build directory next to originalpom.xml
(.git-versioned-pom.xml
)
- Add feature to disable extension by default and enable on demand
⚠️ minimal required maven version is now3.6.3
- remove workaround for maven
3.6.2
compatibility
- new version format placeholder
${ref.slug}
alike${ref}
with all/
replaced by-
- new property
git.ref.slug
alikegit.ref
with all/
replaced by-
- minimal required maven version set to
3.6.3
⚠️ accidentally bump minimal required maven version to3.6.3
- prevent maven from failing, if project is not part of a git repository. Instead a warning is logged.
- fix incompatibility with maven version
3.6.2
- simplify
<property>
replacement configuration
- add missing dependency vor maven version 3.3
-
simplify
<property>
replacement configurationnew config
<gitVersioning> <branch> <pattern>master</pattern> <versionFormat>${version}</versionFormat> <property> <pattern>revision</pattern> <valueFormat>${branch-SNAPSHOT}</valueFormat> </property> </branch> </gitVersioning>
old config
<gitVersioning> <branch> <pattern>master</pattern> <versionFormat>${version}</versionFormat> <property> <pattern>revision</pattern> <value> <format>${branch-SNAPSHOT}</format> </value> </property> </branch> </gitVersioning>
- fix verbose logging when disabling extension by flag
- restrict project versioning to root- and sub-projects
- provide
${git.dirty}
project property
- set execution phase to INITIALIZE
- Fix IntelliJ multi-modules project handling.
- New Provided properties, see Provided Project Properties
git.commit.timestamp
git.commit.timestamp.datetime
- Add parameters and environment variable to disable extension. see Parameters & Environment Variables
- Add config option(
<update>
) to update version in original pom file. see Configure Extension
- Major Refactoring, Simplification
- Also available as Gradle Plugin
- New Provided Project Properties
git.ref
value of branch of tag name, always set
- Restructured XML Config
- renamed root tag
<configuration>
-><gitVersioning>
- removed nested structure
- see Configure Extension
- renamed root tag
- Renamed Environment Variables
MAVEN_PROJECT_BRANCH
->VERSIONING_GIT_BRANCH
MAVEN_PROJECT_TAG
->VERSIONING_GIT_TAG
- Renamed Maven Parameters
-Dproject.branch
->-Dgit.branch
-Dproject.tag
->-Dgit.tag
- Removed Maven Parameters
-DgitVersioning
- disable the extension by a parameter is no longer supported
- Renamed Provided Project Properties
project.branch
->git.branch
project.tag
->git.tag
project.commit
->git.commit