Alex Rivera | Logout

Maven release properties

Asked 2009-06-13T00:06:49.163
10

When we release projects it is usually the same every time. Are there any arguments or properties that I can add to release:prepare that will allow for pattern releasing in batch mode?

Example:

What is the release version for "MyProject"? (company.jar.site:myproject) 0.0.1: : 
What is SCM release tag or label for "MyProject"? (company.jar.site:myproject) MyProject-0.0.1: : 
What is the new development version for "MyProject"? (company.jar.site:myproject) 0.0.2-SNAPSHOT: : 

It would be nice to do something like this:

mvn -B release:perform -DreleaseVersion:$nextMinorVersion$ or
mvn -B release:perform -DreleaseVersion:$nextPatchVersion$ or
mvn -B release:perform -Dtag:v$nextPatchVersion$ or
mvn -B release:perform -Dtag:v$nextPatchVersion$-someCustomNaming 

If something like this does not already exist, I will create a custom Mojo to do so.

Alternatively, during the prompts above we usually do default to the 1st question, 'v' + current version on the second, and next minor on the last. If we could modify these somehow, that would solve the immediate issue.

Thanks in advance.

Edit
Report

1 Answer

2

Partial answer, after your comment:

To change the tag name, use the -Dtag=xxx argument to release:prepare. See the release:prepare documentation for details.

Untested code warning

To do this in a fully automated way, you need to add a configuration entry to your pom.xml where you would set the tag name:

<maven-release-plugin>
   <configuration>
       <tag>parent-${releaseVersion}</tag>
   </configuration>
</maven-release-plugin>
answered 2009-06-15T15:56:55.860

Your Answer