2. Maven Release Process CVS developer 11. Check out POMs 1. Check in code developer 2.0-SNAPSHOT 2.1-SNAPSHOT 4. Tagging release, check in POMs 7. Check in POMs 8. Check out tagged code release-prepare 2.0-SNAPSHOT 2.0 2.1-SNAPSHOT 5. Update POMs 6. Compile, test 2. Update POMs 3. Compile, test Maven Maven 9. Compile, test 10. Deploy artifacts release-perform Nexus 2.0-RELEASE
3.
4. Build and test application APStandard-2.0.1-SNAPSHOTRelease phase prepare 2. Upgrade all POM files from 2.0.1-SNAPSHOT to 2.0.1 3. Compile and test 2.0.1 version 4. Tag sources and commit the modified POMs (Tag: Product-2.0.1) 5. Upgrade all POM files from 2.0.1 to 2.0.2-SNAPSHOT 6. Compile and test 2.0.2-SNAPSHOT version 7. Check in modified POM files Release phase perform 8. Check out code (Tag: Product-2.0.1) tagged in the previous step 9. Compile and test Product-2.0.2-SNAPSHOT 10. Deploy all artifacts under version 2.0.1(jars, packed source code and javadocs) to the Nexus
5. Prepare a Release mvn release:prepare Check that there are no uncommitted changes in the sources Check that there are no SNAPSHOT dependencies Change the version in the POMs from x-SNAPSHOT to a new version (you will be prompted for the versions to use) Transform the SCM information in the POM to include the final destination of the tag Run the project tests against the modified POMs to confirm everything is in working order Commit the modified POMs Tag the code in the SCM with a version name (this will be prompted for) Bump the version in the POMs to a new value y-SNAPSHOT (these values will also be prompted for) Commit the modified POMs
6. Perform Release mvn release:perform This command uses release.properties created by the previous step and does the following Checks out code tagged in the previous step. It figures out the tag version from the release.properties file. Runs maven deploy site-deploy goals to deploy the released version. This step is responsible for deploying the jar or war to the remote repository. Clean up. After the release is done, release.properties file will be deleted.
7. Single line release process mvn release:prepare release:perform -B Batch mode - to prevent the Release Plugin from prompting the user for any information
8. Rollback a Release To rollback a release, the following requirement must be met: You haven't run release:clean on the project. This means that the backup files and the release descriptor from the previous release command still exists When a release is rolled back, the following release phases are executed All project POMs are reverted back to their pre-release state locally, and also in the SCM if the previous release command was able to successfully make changes in the SCM to the POMs. This is done by using the backup files created during release:prepare. The created branch/tag in SCM for the release is removed. Note: This is not yet implemented so you will need to manually remove the branch/tag from your SCM. For more info check MRELEASE-229. To rollback a release execute this command: mvn release:rollback
9. Best practices mvn release:prepare -DdryRun=true Simulates the SCM operations (by writing them out to the console), Creates two sample pom files: pom.xml.tag - will be committed to CVS and tagged pom.xml.next - contains the next snapshot version number.