Author: pgier Date: Tue Apr 22 20:23:08 2008 New Revision: 650734 URL: http://svn.apache.org/viewvc?rev=650734&view=rev Log: [MRELEASE-173] Adding command line version specification for the branch goal.
Modified: maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/MapVersionsPhase.java maven/release/trunk/maven-release-plugin/src/site/apt/examples/branch.apt Modified: maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/MapVersionsPhase.java URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/MapVersionsPhase.java?rev=650734&r1=650733&r2=650734&view=diff ============================================================================== --- maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/MapVersionsPhase.java (original) +++ maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/MapVersionsPhase.java Tue Apr 22 20:23:08 2008 @@ -203,7 +203,7 @@ nextSnapshotVersionInfo = new DefaultVersionInfo( nextDevVersion ); } } - + } catch ( VersionParseException e ) { @@ -233,9 +233,9 @@ ArtifactUtils.isSnapshot( project.getVersion() ) || releaseDescriptor.isUpdateVersionsToSnapshot() ) ) { - if ( currentVersionInfo != null ) + if ( releaseVersionInfo != null ) { - nextVersion = currentVersionInfo.getSnapshotVersionString(); + nextVersion = releaseVersionInfo.getSnapshotVersionString(); } if ( releaseDescriptor.isInteractive() ) @@ -267,10 +267,9 @@ { if ( currentVersionInfo != null ) { - VersionInfo versionInfo = currentVersionInfo.getNextVersion(); - if ( versionInfo != null ) + if ( nextSnapshotVersionInfo != null ) { - nextVersion = versionInfo.getSnapshotVersionString(); + nextVersion = nextSnapshotVersionInfo.getSnapshotVersionString(); } else { Modified: maven/release/trunk/maven-release-plugin/src/site/apt/examples/branch.apt URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-plugin/src/site/apt/examples/branch.apt?rev=650734&r1=650733&r2=650734&view=diff ============================================================================== --- maven/release/trunk/maven-release-plugin/src/site/apt/examples/branch.apt (original) +++ maven/release/trunk/maven-release-plugin/src/site/apt/examples/branch.apt Tue Apr 22 20:23:08 2008 @@ -43,14 +43,31 @@ To execute this step, run: ------- -mvn release:branch +mvn release:branch -DbranchName=my-branch ------- - By default, versions in the new branch aren't modified and versions in the actual branch are updated. If you want to update versions - in the new branch and not in the actual, run: + By default, the pom in the new branch keeps the same version as the local working copy, and the local pom is incremented + to the next revision. If you want to update versions in the new branch and not in the working copy, run: ------- -mvn release:branch -DupdateBranchVersions=true -DupdateWorkingCopyVersions=false +mvn release:branch -DbranchName=my-branch -DupdateBranchVersions=true -DupdateWorkingCopyVersions=false ------- <<Note:>> It can be useful if you want to create a branch from a tag + + +* Specify versions on the command line. + + You may want to specify the versions to use on the command line. This can be useful for example if you are running + the release in non-interactive mode. The branch goal can use the same properties used by the prepare goal for + specifying the versions to be used. + + +----------- +mvn --batch-mode release:branch -Dbranch-name=my-branch-1.2 -Dproject.rel.org.myCompany:projectA=1.2 \ + -Dproject.dev.org.myCompany:projectA=2.0-SNAPSHOT +----------- + + In this example, the pom in the new branch will be set to the version 1.2-SNAPSHOT, and the pom in the + local pom will be set to the version 2.0-SNAPSHOT + \ No newline at end of file