4

I have an OSGi bundle which is in Eclipse IDE represented as Eclipse Plug-in Project. The only way I found to satisfy the dependencies of this plug-in/bundle is to

  • 1) import all dependencies (.jar files) through File > Import... > Plug-ins and Fragments wizard
  • 2) and then declare the imported dependencies in MANIFEST.MF

Yes, this solution works, but on the other hand after I commit the changes to our repository all my team mates also have to manually import dependencies to Eclipse to fix the compilation errors.

QUESTION: Is there a solution which does not require such irritating steps? I just want to pull the changes from repository and continue my work without need to fix the dependecies in MANIFEST.MF again and again...

P.S.: To retrieve dependencies we use Apache Ivy.

Michal Vician
  • 2,486
  • 2
  • 28
  • 47

2 Answers2

4

You need to set up a target platform in Eclipse. I find the easiest way is to put all the dependencies in a folder, and save the target platform as a .target file which I check into source control. Then the only steps my colleagues need to do is retrieve the dependencies and configure Eclipse to use the shared target definition. If we add new dependencies to the definition Eclipse will automatically pick up the changes with a restart or target platform refresh.

The Eclipse documentation should get you started: http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.pde.doc.user/concepts/target.htm

Holly Cummins
  • 10,767
  • 3
  • 23
  • 25
0

If you develop server based applications then it is much better to let maven or Ivy manage the dependencies and use the maven bundle plugin to generate the Manifest. So you can avoid the Eclipse OSGi mode and the target platform. See http://www.liquid-reality.de/x/DIBZ for a tutorial how to develop OSGi bundles using maven and deploy on Apache Karaf. For Ivy you may have to use a slightly different build but the basics should be the same.

Christian Schneider
  • 19,420
  • 2
  • 39
  • 64
  • The solution proposed by Holly Cummins fits great from me since target platform points to folder with modules downloaded by ivy. – Michal Vician May 21 '12 at 19:20