OSGi Binds Dependency Management in Eclipse

I have an OSGi package that is in the Eclipse IDE, presented as an Eclipse plug-in project. The only way I found to satisfy the dependencies of this plugin / package is

  • 1) import all dependencies (.jar files) using the 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 must also manually import the dependencies into Eclipse to fix the compilation errors.

Question : Is there a solution that does not require such annoying steps? I just want to pull the changes from the repository and continue working without having to fix the dependencies in MANIFEST.MF again and again ...

PS: We use Apache Ivy to get dependencies.

+4
source share
2 answers

You need to configure the target platform in Eclipse. I believe that the easiest way is to install all the dependencies in the folder and save the target platform as a .target file, which I will check for source control. Then, the only steps my colleagues should take are getting the dependencies and setting up Eclipse to use a common target definition. If we add new dependencies to the definition, Eclipse will automatically pick up the changes when rebooting or updating the target platform.

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

+4
source

If you are developing server applications, it is much better to allow maven or Ivy to manage dependencies and use the maven bundle plugin to create a manifest. This way you can avoid OSGi Eclipse mode and the target platform. See http://www.liquid-reality.de/x/DIBZ for a tutorial on developing OSGi packages using maven and deploying to Apache Karaf. For Ivy, you may have to use a slightly different assembly, but the basics should be the same.

0
source

Source: https://habr.com/ru/post/1413342/


All Articles