I'm using the Maven Release Plugin and I'm trying to tag every release with my Jenkins build number.
I've tried this from pom.xml
:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.3</version>
<configuration>
<tagNameFormat>${env.BUILD_NUMBER}</tagNameFormat>
</configuration>
</plugin>
And also from Jenkins when I'm calling Maven:
mvn release:prepare -tag=${env.BUILD_NUMBER}
However, I'm getting:
Unable to tag SCM
[ERROR] Provider message:
[ERROR] The git-tag command failed.
[ERROR] Command output:
[ERROR] fatal: tag 'my-project-1.3' already exists
I'm not sure what 1.3
stands for.
So how can I tag the release? I am doing any mistake?