SKM IT World

Just another blog about IT

Automated Build of RCP Artifacts with Maven Tycho – A field report (Part 2)

Leave a comment


In my last post of this series, I described how to solve the dependency problem. In this post, I will describe how to build Eclipse Plugin and Eclipse Feature with Maven Tycho and which problems I have.

POM Definition

The procedure for both Eclipse artifacts is similar. In both, you have to insert a pom.xml and fill it with the Maven coordinate (group id, artifact id and version) and the packaging type. But there exists some rules about the content.

The packaging type is depended on what Eclipse artifact should be built:

Eclipse ArtifactPackaging Type
Eclipse Plugineclipse-plugin
Eclipse Featureeclipse-feature

The version specification in the POM is depended on the version specification in the manifest (in case of Eclipse plugin) and by the version specification in the feature.xml (in case of Eclipse feature) respectively:

MANIFEST.MF / feature.xmlpom.xmlDescription
1.5.1.qualifier1.5.1-SNAPSHOTDevelopment version
1.5.11.5.1Release version

\The specification of the artifact id in the POM must be equal like the bundle symbolic name in the manifest (in case of Eclipse plugin) and by the specification of the id in the feature.xml (in case of Eclipse feature) respectively. That’s all you need to define the pom.xml. Then call only mvn clean install and the Eclipse artifact is built by Maven Tycho.

Troubleshooting

I met two problems during the introduction of Maven Tycho for the building of Eclipse plugins. The first problem was that Maven Tycho sometimes throws a NullPointerException during the read-out of the manifest file. The reason is that a blank must be between the colon, that follows after the manifest header, and the command.

# Don't
Import-Package:com.library.*
# Do
Import-Package: com.library.*

The second problem was that Maven Tycho throws compiler error although everything is alright in Eclipse. The analyze of the error message shows that the command for the Import-Package in the manifest is not completed. A second analyze shows that package names of used Eclipse RCP artifacts are missing. After adding these missing package names in the manifest, Maven Tycho builds without error. But this also means that Eclipse does not generate the manifest osgi-compliantly.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.