3 min. reading time

Setting up Maven Tycho projects for building Eclipse plugins is not trivial and building releases from that setup is much more complicated than it sounds. If you are used to release your artifacts using the Maven Release Plugin you'll get quickly frustrated if you try this for your Tycho setup.

What is the reason for that?

Building Eclipse plugins, or OSGi bundles in general, requires some artifacts such as the MANIFEST.MF or the feature.xml to carry information about the bundle. This can be version numbers or dependencies. Maven manages those information in its build description, the Project Object Models (POM).

Now when building bundles with Maven it is necessary to keep these information in sync so that the bundles match their meta information in the Maven repositories. This typically requires a manual or sem-automated step for which the Tycho Versions Plugin provides some support.

Why is that a problem?

The Maven Release Plugin automates the process of building release artifacts by implementing some kind of standard workflow. This workflow handles the preparation of the project for the release as well as the actual building and deployment of the artifacts.

The problematic part here is that the preparation of the project includes some version changes that are not aware of the OSGi (or Eclipse) artifacts. Their versions still remain unchanged, which produces invalid release artifacts. It is simply not possible to intercept the version adaption mechanism in order to update the MANIFESTs for example.

What is the solution?

You could write some scripts that automate the process by calling different plugins such as the Tycho Versions Plugin, the Maven SCM Plugin and so on. Or you could simply use the Unleash Maven Plugin with its dedicated Tycho Release goal (perform-tycho) to build your release the easy way! The simplest way to build a Tycho release is calling

mvn unleash:perform-tycho

The Unleash Maven Plugin is a powerful Maven plugin that implements a workflow-based release processing approach. It is fully customizable, extendable and provides integrated rollback features. If you want more more information about the Unleash Maven Plugin check my other blog post which explains the basic idea of the plugin as well as its concepts

 

Comments