Search code examples
javaeclipsemavenreleasetycho

How do I create an Eclipse plugin release using Maven and Tycho?


I am building an Eclipse project that consists of a number of plug-ins that are packed together. I have create POM files for each component and a main POM for the project. Something like this:

projectDir\releng\pom.xml <-- Parent project
projectDir\proj1\pom.xml  <-- Child project 1
projectDir\proj2\pom.xml  <-- Child project 2

My build currently works by calling the parent POM which builds everything. Until now I have been building using 0.0.1-SNAPSHOT as the version of the parent POM, and in each Eclipse plug-in I have 0.0.1.qualifier as the version in the MANIFEST.MF file.

I now want to promote my latest version to 0.1.0. From my understanding, this means that I have to go over ALL of my POM files AND MANIFEST.MF files and upgrade the version in both of them (since while the version is defined in the parent POM, it is referenced in all child POM:s).

Is this the correct way to do this or is there a way to automate the whole process and not make mistakes?

P.S. There is the Maven Release plugin but this won't work with Eclipse.


Solution

  • For the version update step of a relase process, there is the tycho-versions-plugin which knows how to consistently update the POMs and manifests.

    Just go to the root of your parent/aggregator module and call

    mvn org.eclipse.tycho:tycho-versions-plugin:set-version -DnewVersion="0.1.0"
    

    This will update the version of the parent project and of all child projects with the same/equivalent version as the parent project. In your case, these are all projects because the Eclipse versions 0.0.1.qualifier is considerered equivalent to 0.0.1-SNAPSHOT in Tycho.


    For the remaining steps of the release process (tagging, building, pushing tags, etc.) just call the appropriate SCM or Maven commands, e.g. from a script. I haven't tried to use the maven-release-plugin for this (and apparently no-one else has).