0

I want to include org.eclipse.uml2.uml_4.0.0.v20120604-0919.jar in a Maven module. I've set up the p2 repository

<repository>
    <id>juno</id>
    <layout>p2</layout>
    <url>http://download.eclipse.org/releases/juno</url>
</repository>

and configured the Tycho build extension. Which groupdId and artifactId do I have to use so that Tycho will include org.eclipse.uml2.uml_4.0.0.v20120604-0919.jar as a dependency?

oberlies
  • 11,503
  • 4
  • 63
  • 110
SpaceTrucker
  • 13,377
  • 6
  • 60
  • 99
  • Are you using the packaging type `eclipse-plugin`? If yes, please include this in the question. – oberlies Sep 13 '12 at 15:56
  • Actually it isn't clarified if this should be an eclipse plugin or some other component. Maybe this has to be embedded in a maven mojo. But currently I'm packaging this as an eclipse plugin and it works like you described in your answer. – SpaceTrucker Sep 14 '12 at 08:43
  • 1
    Unfortunately, you have to use one of Tycho's packaging types for Tycho to work. So you for example could not use the packaging type `jar` with Tycho. However, you can add plain Maven goals individually in the POM, and this should work. – oberlies Sep 14 '12 at 11:38

1 Answers1

2

In Tycho, you need to specify the dependencies of your plug-in in the OSGi manifest file (META-INF/MANIFEST.MF). So for the given Eclipse plugin, you would write something like

Require-Bundle: org.eclipse.uml2.uml

You cannot do the same through POM configuration.

The idea behind this is that Tycho follows the so-called Manifest-first approach. The primary configuration files for Tycho are the OSGi manifest and the other Eclipse PDE file formats (like feature.xml, *.product files, etc.).

Other tools, like the maven-bundle-plugin follow the POM-first approach of building OSGi bundles. For the maven-bundle-plugin, you'd need to specify the dependencies in the POM, and the manifest is generated accordingly.

oberlies
  • 11,503
  • 4
  • 63
  • 110