MAY Plugin Release Process » Historique » Version 3
Anonyme, 23/10/2014 15:45
| 1 | 1 | Anonyme | h1. MAY Plugin Release Process |
|---|---|---|---|
| 2 | 2 | Anonyme | |
| 3 | {{>toc}} |
||
| 4 | |||
| 5 | MAY is an Eclipse plugin, it is thus distributed using an Eclipse update site, but parts of it are also available through Maven Central for [[MAY Maven Standalone Setup|standalone use without Eclipse]]. |
||
| 6 | |||
| 7 | h2. General Overview |
||
| 8 | |||
| 9 | h3. Phases |
||
| 10 | |||
| 11 | Releasing MAY implies different phases: |
||
| 12 | # Preparing for the release |
||
| 13 | # Tagging the release on Mercurial |
||
| 14 | # Deploying the release on Maven Central |
||
| 15 | # Deploying the release in the update site |
||
| 16 | # Preparing the next development cycle |
||
| 17 | |||
| 18 | All of this is of course fairly automatised using Maven, Tycho for the integrating Eclipse aspects with Maven and some Bash scripts. |
||
| 19 | |||
| 20 | h3. Modules |
||
| 21 | |||
| 22 | MAY is decomposed in 5 different software modules (which are to 5 Maven projects and some of them Eclipse artefacts): |
||
| 23 | 3 | Anonyme | * *fr.irit.smac.may.speadl.parent*: it contains general Maven instructions shared by the other modules. |
| 24 | * *fr.irit.smac.may.speadl*: it contains the code for the Eclipse plugin, without the UI aspects, and it is also the Maven artefact needed for [[MAY Maven Standalone Setup|standalone use without Eclipse]]. |
||
| 25 | * *fr.irit.smac.may.speadl.ui*: it contains the UI code for the Eclipse plugin. |
||
| 26 | * *fr.irit.smac.may.speadl.feature*: it is an installable unit from the update site that combines the two previous Eclipse plugins. |
||
| 27 | * *fr.irit.smac.may.speadl.updatesite*: it contains everything needed for generating and deploying the update site containing the previous feature. |
||
| 28 | 2 | Anonyme | |
| 29 | Only the first two are deployed to Maven Central. |
||
| 30 | The plugins and the features will end up in the update site. |
||
| 31 | |||
| 32 | h3. Syntactical Version Numbering |
||
| 33 | |||
| 34 | The Eclipse plugins follow the OSGI version numbering and it is stored in the *MANIFEST.MF* file of each project. |
||
| 35 | The Maven artefact follows the Maven version numbering and it is stored in the *pom.xml* file of each project. |
||
| 36 | All are using the 3 digits "SemVer":http://semver.org/ system (Major.Minor.Patch). |
||
| 37 | |||
| 38 | For the plugins, this is followed by a qualifier (Major.Minor.Patch.qualifier) that is replaced with the compilation time and date. |
||
| 39 | For the Maven artefacts, 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. |
||
| 40 | |||
| 41 | So the plugins always have the qualifier while the Maven artefacts have the SNAPSHOT information only for development. |
||
| 42 | |||
| 43 | h3. Semantic Version Numbering |
||
| 44 | |||
| 45 | The MAJOR number changes when the syntax is incompatible with the previous one. |
||
| 46 | The MINOR number changes when the generated code is incompatible with the previous one. |
||
| 47 | The PATCH number changes for the rest. |
||
| 48 | |||
| 49 | h3. Example |
||
| 50 | |||
| 51 | 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). |
||
| 52 | |||
| 53 | h2. Preparing for the Release |
||
| 54 | |||
| 55 | First, everything must be committed to Mercurial before doing the version update (this can be verified with @hg status@ before). |
||
| 56 | |||
| 57 | We just finished developing the 3.4.0-SNAPSHOT version and want to release the new 3.4.0 version. |
||
| 58 | We must update the POM files to reflect that, but do not touch the MANIFEST files: |
||
| 59 | <pre> |
||
| 60 | $ cd fr.irit.smac.may.speadl.parent |
||
| 61 | $ mvn -Dtycho.mode=maven versions:set -DnewVersion=3.4.0 |
||
| 62 | </pre> |
||
| 63 | |||
| 64 | This is done from the parent directory and will impact all the modules. |
||
| 65 | 3 | Anonyme | The @-Dtycho.mode=maven@ argument tells Maven not to try to resolve Eclipse aspects that takes time and are useless here. |
| 66 | 2 | Anonyme | |
| 67 | Now our Maven artefacts are versioned 3.4.0 while the plugins are versioned 3.4.0.qualifier. |
||
| 68 | |||
| 69 | h2. Tagging the Release |
||
| 70 | |||
| 71 | Now we commit these changes and tag them in Mercurial: |
||
| 72 | <pre> |
||
| 73 | $ hg commit -m "prepare for 3.4.0 release" |
||
| 74 | $ hg tag v3.4.0 |
||
| 75 | </pre> |
||
| 76 | |||
| 77 | The commit must only change the POM files, nothing else (this can be verified with @hg status@ before). |
||
| 78 | |||
| 79 | h2. Deploying the Release on Maven Central |
||
| 80 | 1 | Anonyme | |
| 81 | Then, the release has to be deployed to Maven Central: |
||
| 82 | <pre> |
||
| 83 | $ mvn -P release clean deploy |
||
| 84 | </pre> |
||
| 85 | |||
| 86 | 3 | Anonyme | 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. |
| 87 | |||
| 88 | Note that to deploy to Maven Central, it is needed to: |
||
| 89 | * 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. |
||
| 90 | * 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. |
||
| 91 | |||
| 92 | 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. |
||
| 93 | |||
| 94 | h2. Deploying the Release in the Update Site |
||
| 95 | |||
| 96 | The update site contains all releases of MAY, not just the last one: in order to add a new version, it is first needed to get the current update site, to add the plugins and features, and finally to update some metadata in it. |
||
| 97 | |||
| 98 | h3. Getting the Current Update Site |
||
| 99 | |||
| 100 | The update site of MAY is stored on the IRIT servers. |
||
| 101 | A copy must be made locally, for example using SSH and rsync: |
||
| 102 | <pre> |
||
| 103 | $ rsync -azv -e "ssh USER@sash.irit.fr ssh" USER@bali:/REMOTE/PATH/TO/UPDATE/SITE /LOCAL/PATH/TO/UPDATE/SITE |
||
| 104 | </pre> |
||
| 105 | |||
| 106 | Or directly by mounting it through SSH: |
||
| 107 | <pre> |
||
| 108 | $ sshfs USER@bali:/REMOTE/PATH/TO/UPDATE/SITE /LOCAL/PATH/TO/UPDATE/SITE |
||
| 109 | </pre> |
||
| 110 | |||
| 111 | The choice of the method is out of the scope of this document, the important point is to have a locally accessible directory of the existing update site. |
||
| 112 | |||
| 113 | h3. Add New Version to Update Site and Update Metadata |
||
| 114 | |||
| 115 | Use the following to update the update site with new version: |
||
| 116 | <pre> |
||
| 117 | $ cd ../fr.irit.smac.may.speadl.updatesite |
||
| 118 | $ mvn -Dtycho.mode=maven -Dfinal-update-site=/LOCAL/PATH/TO/UPDATE/SITE tycho-p2-extras:publish-features-and-bundles tycho-p2:category-p2-metadata |
||
| 119 | </pre> |