Release With Maven

1,847 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,847
On SlideShare
0
From Embeds
0
Number of Embeds
8
Actions
Shares
0
Downloads
23
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Release With Maven

  1. 1. Maven<br />Release process<br />eugen.nekhai@gmail.com<br />
  2. 2. Maven Release Process<br />CVS<br />developer<br />11. Check out POMs<br />1. Check in code<br />developer<br />2.0-SNAPSHOT<br />2.1-SNAPSHOT<br />4. Tagging release, check in POMs<br />7. Check in POMs<br />8. Check out tagged code<br />release-prepare<br />2.0-SNAPSHOT<br />2.0<br />2.1-SNAPSHOT<br />5. Update POMs<br />6. Compile, test<br />2. Update POMs<br />3. Compile, test<br />Maven<br />Maven<br />9. Compile, test<br />10. Deploy artifacts<br />release-perform<br />Nexus<br />2.0-RELEASE<br />
  3. 3. Maven Release Process<br />Development version 2.0.1-SNAPSHOT<br />1. Developer check in code to CVS<br />On the API side (Verification):<br /><ul><li>Download code from CVS
  4. 4. Build and test application APStandard-2.0.1-SNAPSHOT</li></ul>Release phase prepare<br />2. Upgrade all POM files from 2.0.1-SNAPSHOT to 2.0.1<br />3. Compile and test 2.0.1 version<br />4. Tag sources and commit the modified POMs (Tag: Product-2.0.1)<br />5. Upgrade all POM files from 2.0.1 to 2.0.2-SNAPSHOT <br />6. Compile and test 2.0.2-SNAPSHOT version<br />7. Check in modified POM files<br />Release phase perform<br />8. Check out code (Tag: Product-2.0.1) tagged in the previous step<br />9. Compile and test Product-2.0.2-SNAPSHOT<br />10. Deploy all artifacts under version 2.0.1(jars, packed source code and javadocs) to the Nexus<br />
  5. 5. Prepare a Release<br />mvn release:prepare <br />Check that there are no uncommitted changes in the sources<br />Check that there are no SNAPSHOT dependencies<br />Change the version in the POMs from x-SNAPSHOT to a new version (you will be prompted for the versions to use)<br />Transform the SCM information in the POM to include the final destination of the tag<br />Run the project tests against the modified POMs to confirm everything is in working order<br />Commit the modified POMs<br />Tag the code in the SCM with a version name (this will be prompted for)<br />Bump the version in the POMs to a new value y-SNAPSHOT (these values will also be prompted for)<br />Commit the modified POMs<br />
  6. 6. Perform Release<br />mvn release:perform <br />This command uses release.properties created by the previous step and does the following<br />Checks out code tagged in the previous step. It figures out the tag version from the release.properties file.<br />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.<br />Clean up. After the release is done, release.properties file will be deleted.<br />
  7. 7. Single line release process<br />mvn release:prepare release:perform -B<br />Batch mode - to prevent the Release Plugin from prompting the user for any information<br />
  8. 8. Rollback a Release<br />To rollback a release, the following requirement must be met:<br />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<br />When a release is rolled back, the following release phases are executed<br />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.<br />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.<br />To rollback a release execute this command:<br />mvn release:rollback<br />
  9. 9. Best practices<br />mvn release:prepare -DdryRun=true <br />Simulates the SCM operations (by writing them out to the console),<br />Creates two sample pom files: <br />pom.xml.tag - will be committed to CVS and tagged<br />pom.xml.next - contains the next snapshot version number.<br />
  10. 10. ?<br />eugen.nekhai@gmail.com<br />

×