0

I'm new to OSGi and Karaf and have understanding problem how to integrate a Maven generated POM into Eclipse.

I've created a Maven Karaf archetype using the "karaf-bundle-archetype" as described on the Karaf tutorial [link]

mvn archetype:generate \
    -DarchetypeGroupId=org.apache.karaf.archetypes \
    -DarchetypeArtifactId=karaf-bundle-archetype \
    ...

It generates a pom.xml that I imported into Eclipse as "... existing Maven project". That worked so far.

But then how to proceed in Eclipse? Eclipse does not know that this is a plugin project, e.g. the MANIFEST.MF is missing.

"Converting the project" to a plug-in project generated a MANIFEST.MF, but nearly empty and unusable.

I have no clue what is the best way to proceed.

Thanks for any help ! Gerry

Neil Bartlett
  • 23,743
  • 4
  • 44
  • 77
user1226230
  • 381
  • 1
  • 3
  • 11
  • You don't need it to be a plug-in project. The output from the build will be a bundle (plugin) with a `MANIFEST.MF`. – Neil Bartlett Feb 05 '16 at 11:19
  • Thanks Neil for the fast response. But that's the point, the mvn command above did not generate a MANIFEST.MF. I have to add and manipulate the MF – user1226230 Feb 05 '16 at 13:12

1 Answers1

0

The karaf-bundle-archetype uses the pom first approach. So it is not compatible to the plugin perspective or maven tycho. The good thing is that you can develop bundles just like normal java maven projects.

Most of the Manifest settings will be auto discovered. You should try to use the defaults as much as possible. If you want to achieve some special settings you can tune the configuration of the maven bundle plugin.

This can either be done in the pom or in a bnd.bnd file. I prefer the second approach. You can find some examples of it in the karaf tutorials.

Christian Schneider
  • 19,420
  • 2
  • 39
  • 64
  • Thank you Christian for the response. I already discovered your tutorials, thanks ! When I understand your comment, does it mean that there will be no MANIFEST.MF ever appear in my workspace, rather it is implicitly built my MVN ? If so, how to initiate such a build ? – user1226230 Feb 05 '16 at 13:32
  • Yes .. the Manifest is created by maven. You simply do a mvn install to trigger the maven build. You should also use the m2e plugin for eclipse to handle the maven projects. – Christian Schneider Feb 05 '16 at 14:41