MAY Lib Release Process » Historique » Version 3
Anonyme, 30/10/2014 13:35
| 1 | 1 | Anonyme | h1. MAY Component Library Release Process |
|---|---|---|---|
| 2 | 2 | Anonyme | |
| 3 | {{>toc}} |
||
| 4 | |||
| 5 | The component library is a set of projects containing component definitions and implementation to be reused. |
||
| 6 | They are available through Maven Central for [[MAY Maven Eclipse Setup|use with Maven]]. |
||
| 7 | |||
| 8 | h2. General Overview |
||
| 9 | |||
| 10 | h3. Phases |
||
| 11 | |||
| 12 | Releasing the components implies different phases: |
||
| 13 | # Preparing for the release |
||
| 14 | # Tagging the release on Mercurial |
||
| 15 | # Deploying the release on Maven Central |
||
| 16 | # Preparing the next development cycle |
||
| 17 | |||
| 18 | All of this is of course fairly automatised using Maven. |
||
| 19 | |||
| 20 | h3. Modules |
||
| 21 | |||
| 22 | 3 | Anonyme | See [[MAY Lib Architecture]]. |
| 23 | 2 | Anonyme | |
| 24 | h3. Syntactical Version Numbering |
||
| 25 | |||
| 26 | The Maven artefact follows the Maven version numbering and it is stored in the *pom.xml* file of each project. |
||
| 27 | All are using the 3 digits "SemVer":http://semver.org/ system (Major.Minor.Patch). |
||
| 28 | |||
| 29 | For non-release (development versions), this is followed by the SNAPSHOT element (Major.Minor.Patch-SNAPSHOT) that is replaced with the compilation time and date on deployment. |
||
| 30 | |||
| 31 | h3. Semantic Version Numbering |
||
| 32 | |||
| 33 | The MAJOR and MINOR number follows the numbering of the MAY plugin as explained on that [[MAY Plugin Release Process|page]]. |
||
| 34 | The PATCH number changes for the rest. |
||
| 35 | |||
| 36 | h3. Example |
||
| 37 | |||
| 38 | For the sake of this guide, we will consider that we are releasing a new version numbered 3.4.0 (and thus we were developing 3.4.0-SNAPSHOT). |
||
| 39 | |||
| 40 | h2. Preparing for the Release and Tagging it |
||
| 41 | |||
| 42 | First, everything must be committed to Mercurial before doing the version update (this can be verified with @hg status@ before). |
||
| 43 | Let's say we just finished developing the 3.4.0-SNAPSHOT version and want to release the new 3.4.0 version. |
||
| 44 | |||
| 45 | h3. Updating the POM Files |
||
| 46 | |||
| 47 | We must update the POM files to reflect that, but do not touch the MANIFEST files: |
||
| 48 | <pre> |
||
| 49 | $ cd parent |
||
| 50 | $ mvn versions:set -DnewVersion=3.4.0 |
||
| 51 | </pre> |
||
| 52 | |||
| 53 | This is done from the parent directory and will impact all the modules. |
||
| 54 | |||
| 55 | h3. Tagging the Release |
||
| 56 | |||
| 57 | Now we commit these changes and tag them in Mercurial: |
||
| 58 | <pre> |
||
| 59 | $ hg commit -m "prepare for 3.4.0 release" |
||
| 60 | $ hg tag v3.4.0 |
||
| 61 | </pre> |
||
| 62 | |||
| 63 | The commit should only change the POM files, nothing else (this can be verified with @hg status@ before). |
||
| 64 | |||
| 65 | h2. Deploying the Release on Maven Central |
||
| 66 | |||
| 67 | Then, the release has to be deployed to Maven Central: |
||
| 68 | <pre> |
||
| 69 | $ cd ../ |
||
| 70 | $ mvn -P release clean deploy |
||
| 71 | $ mvn nexus-staging:release |
||
| 72 | </pre> |
||
| 73 | |||
| 74 | This will clean the sources, compile everything, create packages, install them in the local maven repository and finally deploy the *fr.irit.smac.may.speadl.parent* and *fr.irit.smac.may.speadl* modules to Maven Central. |
||
| 75 | |||
| 76 | Note that to deploy to Maven Central, it is needed to: |
||
| 77 | * Have a Sonatype JIRA account linked to "this ticket":https://issues.sonatype.org/browse/OSSRH-12012 as explained on "this page":http://central.sonatype.org/pages/ossrh-guide.html. |
||
| 78 | * Have a GnuPG key to sign the packages as explained on "this page":http://central.sonatype.org/pages/requirements.html and "this page":http://central.sonatype.org/pages/apache-maven.html. |
||
| 79 | |||
| 80 | The @-P release@ argument is important so that the deployed artefacts have a source and javadoc associated artefact and are signed as needed by Maven Central. |
||
| 81 | The @nexus-staging:release@ goal must be called to actually accept the deployment and release it on Maven Central: that last phase can also be done "trough the Nexus UI":http://central.sonatype.org/pages/releasing-the-deployment.html. |
||
| 82 | |||
| 83 | h2. Preparing the Next Development Cycle |
||
| 84 | |||
| 85 | Now everything is deployed, we can prepare the next development cycle by increasing the version to a SNAPSHOT one: |
||
| 86 | <pre> |
||
| 87 | $ cd ../parent |
||
| 88 | $ mvn -DnewVersion=3.4.1-SNAPSHOT |
||
| 89 | </pre> |
||
| 90 | |||
| 91 | And then, we can commit it and push all the changes we made: |
||
| 92 | <pre> |
||
| 93 | $ hg commit -m "increment to 3.4.1 development version" |
||
| 94 | $ hg push |
||
| 95 | </pre> |