jgitver / jgitver-maven-plugin

maven core extension to automatically define versions using jgitver & git tags
https://jgitver.github.io/
Other
159 stars 42 forks source link

Version calculation on branches breaking change from 1.7.1 to 1.8.0 #166

Open fjakop opened 2 years ago

fjakop commented 2 years ago

version: 1.8.0

usage context:

maven command line: 3.8.3

Problem description:

I create a non-default branch, e.g. dev/feature, do a commit on this branch and tag this commit with an annotated tag, e.g. 3.0.1.

jGitVer-maven-plugin v1.7.1 would calculate _3.0.1-devfeature on mvn validate which is a qualified release version. jGitVer-maven-plugin v1.8.0 would calculate _3.0.2-devfeature-SNAPSHOT on mvn validate which is a snapshot version.

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-extensions-1.0.0.xsd">
    <extension>
        <!-- see https://github.com/jgitver/jgitver-maven-plugin -->
        <groupId>fr.brouillard.oss</groupId>
        <artifactId>jgitver-maven-plugin</artifactId>
        <version>1.8.0</version>
    </extension>
</extensions>

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">
    <exclusions>
        <exclusion>${maven.repo.local}</exclusion>
    </exclusions>
</configuration>

No further configuration in pom.xml

I would expect the same behaviour as in 1.7.1, as this change would be a breaking one.