How to skip commit id on tags with maven and jgitver

519 views Asked by At

We've been using jgitver maven plugin in the version 1.5.1 until recently and now we are testing the 1.9.0 version. We configured it in a way that will add all the bells and whistles for branches but for tags there should be only the tag name. It worked in 1.5.1 but stopped working in 1.9.0 - even for annotated tags the version now contains the commit id. Is there a way to have those tags without that commit id attached? I looked up the options but I don't see anything that could help here. Maybe there is some magic constant for nonQualifiedBranches that will apply to tags? I'd rather not use the scripting strategy if it's possible.

For example, I make an annotated tag v1.2.3 and the version I get is 1.2.3-0023a2bda or something like that instead of expected 1.2.3

.mvn/jgitver.config.xml

<configuration xmlns="http://jgitver.github.io/maven/configuration/1.1.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://jgitver.github.io/maven/configuration/1.1.0 https://jgitver.github.io/maven/configuration/jgitver-configuration-v1_1_0.xsd">
    <strategy>CONFIGURABLE</strategy>
    <autoIncrementPatch>false</autoIncrementPatch>
    <useCommitDistance>true</useCommitDistance>
    <useDirty>true</useDirty>
    <useGitCommitId>true</useGitCommitId>
    <gitCommitIdLength>8</gitCommitIdLength>  <!-- between [8,40] -->
    <nonQualifierBranches>master</nonQualifierBranches>
    <exclusions>
        <exclusion>.m2</exclusion>
    </exclusions>
</configuration>

.mvn/extensions.xml

<extensions xmlns="http://maven.apache.org/EXTENSIONS/1.0.0" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/EXTENSIONS/1.0.0 http://maven.apache.org/xsd/core- 
xtensions-1.0.0.xsd">
  <extension>
    <groupId>fr.brouillard.oss</groupId>
    <artifactId>jgitver-maven-plugin</artifactId>
    <version>1.9.0</version>
  </extension>
</extensions>
0

There are 0 answers