Mvn release: auto-detect scm tag that includes release version

I would like to configure my maven release to run in batch mode, but I'm not a fan of the standard scm tag ${artifactId}-${releaseVersion} . Instead, I would just tag it ${releaseVersion} ; however, I do not know if such a property exists (i.e. without the -SNAPSHOT suffix).

I would like the configuration to be similar to the code below. Is such a default tag possible with the maven-release plugin?

 <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-release-plugin</artifactId> <version>2.0</version> <configuration> <tag>${releaseVersion}</tag> </configuration> </plugin> 
+4
source share
3 answers

try the following:

 <configuration> <tag>${project.version}</tag> </configuration> 
-2
source

I just got it to work when Hudson used my release. I noted that Hudson (with the Maven release plugin) runs a command with a property like -Dproject.rel.com.example: my-artifact-id = 1.0.1. Using the following plugin configuration:

 <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-release-plugin</artifactId> <configuration> <tag>REL-${project.rel.com.example:my-artifact-id}</tag> </configuration> </plugin> 

Result in tag REL-1.0.1

I'm new to the release plugin, but I would suggest that something similar would work on the command line.

+1
source

You can pass properties to:

releaseVersion - which version do you want it to be released as (1.0) developmentVersion - Next version (2.0-SNAPSHOT) tag - tag name

1.0-SNAPSHOT implies version 1.0, but does not install it. You can set this property in your POM file as a regular property.

0
source

Source: https://habr.com/ru/post/1304460/


All Articles