Sometimes it's necessary to branch the codebase before performing a project release. For example, this is useful when the release process is time consuming and development needs to continue in the main branch.
The Maven Release Plugin (Branch Mojo) can be used to automate the process of branching the codebase prior to performing the actual release. The benefits of performing this process is:
Ensure new featuresets and development unnecessary for this release may continue as normal in trunk
Isolate your release from unrelated development
Provide easy mechanism to make subsequent minor revision releases (0.1.1.Beta1, 0.1.1.Beta2, etc) without increasing version number
- You should have write access to the current checked out repository of the project you are working on.
Make sure you have properly configured the Maven Release Plugin in your POM. This normally just involves checking the scm url fields.
Ensure you have no local modifications to your working copy
Using the Maven Release Plugin
Use the "branch" mojo of the maven release plugin.
mvn release:branch -DbranchName=[project-name]-XX.YY.ZZ
In most cases, "XX.YY.ZZ" is the same "XX.YY.ZZ-SNAPSHOT" currently defined in the trunk pom.xml.
Maven will perform the appropriate SVN Copy commands, make your branch, and increment your local WC version number to a version you'll specify when prompted (there are intelligent defaults).
After completion, you will need to perform a checkout from the new branch. You may then follow the steps described in the JBoss Project Release Process to release from the local working copy of the newly-created Branch.
Reference: Maven Release Plugin Branch Mojo
If you do not want to use the Maven release plugin to create the branch, you can instead use the command line svn client.
- Update the versions in your project POMs (Update Maven Project Versions )
- Commit the changes to the versions (svn commit -m "Updating versions for branch x.y.x)
- Copy the remote trunk to the new branch
svn copy https://svn.jboss.org/repos/my-repo/my-project/trunk https://svn.jboss.org/repos/my-repo/my-project/branches/branch-x.y.z
- Update the trunk versions back to the correct version.
- Commit the changes to trunk.