Closed kjozsa closed 1 year ago
wow, that sounds exactly like what I need!! Let me test on Monday and I'll close my question then - thanks much!
Thanks, that does exactly what I was looking for :)
@kjozsa Sorry to bother you, but do you have an example of the configuration to get the same behavior as jgitver? Just in the process of creating a release and can't quite get it to work.
here's my config
<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-9.4.0.xsd">
<refs considerTagsOnBranches="true">
<ref type="tag">
<pattern><![CDATA[v(?<version>.*)]]></pattern>
<version>${ref.version}</version>
<properties>
<project.build.outputTimestamp>${commit.timestamp}</project.build.outputTimestamp>
</properties>
</ref>
<ref type="branch">
<pattern>(main|release.*)</pattern>
<version>${describe.tag.version.major}.${describe.tag.version.minor}.${describe.tag.version.patch.next}-SNAPSHOT</version>
<properties>
<project.build.outputTimestamp>${commit.timestamp}</project.build.outputTimestamp>
</properties>
</ref>
<ref type="branch">
<pattern><![CDATA[feature/(?<feature>.+)]]></pattern>
<version>${describe.tag.version}-${ref.feature}-SNAPSHOT</version>
<properties>
<project.build.outputTimestamp>${commit.timestamp}</project.build.outputTimestamp>
</properties>
</ref>
</refs>
<rev>
<version>${commit}</version>
</rev>
</configuration>
Our scenario: the branch HEAD also has a tag (say,
v1.25.0
). If I checkout the branch, this plugin matches the branch, generating a version like1.25.1-SNAPSHOT
. If I checkout the tag directly instead (which refers to the same commit as the branch head!), then the generated version is1.25.0
, right what I'd expect.Would it be possible to match the tag on the branch's changeset when the branch is checked out, instead of the branch itself? That would make it really convenient to just create a tag on the HEAD of the branch and automatically end up with a release version when built by CI/CD..
Can you consider this feature, even as an optinal one, enabled by some config setting?