I want to be able to do something like:
mvn release:branch -DbranchName=${project.version}
I'm sure this won't work and I'm asking for help on how to achieve it. mvn release:branch require a branchName. I need the branchName on the command line argument taking the project version as value. My pom looks like this:
<profile>
<id>branch</id>
<activation>
<property>
<name>branchName</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.4.1</version>
<configuration>
<tagNameFormat>v@{project.version}-beta</tagNameFormat>
<autoVersionSubmodules>true</autoVersionSubmodules>
<suppressCommitBeforeBranch>true</suppressCommitBeforeBranch>
<remoteTagging>false</remoteTagging>
</configuration>
</plugin>
</plugins>
</build>
</profile>
This profile is triggerred only when branchName is present on the command line argument.
I appreciate your help.
Edit: updated pom
<profile>
<id>branch</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.4.1</version>
<configuration>
<branchName>@{project.version}</branchName>
<tagNameFormat>v@{project.version}-beta</tagNameFormat>
<autoVersionSubmodules>true</autoVersionSubmodules>
<suppressCommitBeforeBranch>true</suppressCommitBeforeBranch>
<remoteTagging>false</remoteTagging>
</configuration>
</plugin>
</plugins>
</build>
</profile>