0

Let's consider the following projects:

  • Project1: uses Eclipse P2 Target Definition for dependencies
  • Project2: uses Maven repositories for dependencies

The problem: project1 requires a dependency which is present in project2 which comes from a Maven repository (and is not available in p2).

My workaround up to now is that I am exporting project2 as a jar with dependencies. Then, I add this jar to project1 and can access the dependency from there.

How could I do this in a better way?

user3726374
  • 583
  • 1
  • 4
  • 24
  • This question is too broad because it highly depends on which toolset you want to use. Just PDE UI or also some kind of automated build tool, e.g. Tycho. Without you taking this choice first, there are just too many possible answers. – oberlies Dec 01 '14 at 14:33

2 Answers2

0

What do you mean with a better way?, What do you think you are doing wrong?

The only way to use libraries or classes from external projects is by importing the package that contains them. In this case, i guess you made this package using (on your second project) mvn install, mvn package or similar, which is perfectly fine...

If you import to your first project the jar that you just created it is ok too!, there is no better way to do this unless you combine both projects and make them a single one.

Cesar Villasana
  • 681
  • 3
  • 6
  • Okay, my question may be strange because I am quite new to this topic. My problem is the import of the jar file. So what I am doing: building project2 and then manually add the jar to project1. What I would like to do is something like "export package" for the maven dependency in project2. – user3726374 Nov 25 '14 at 20:42
0

You could use Package Drone, an open source tool I am currently working on. If your maven dependencies are OSGi bundles, you can drop them into Package Drone and let it create a P2 repository from it. So you can re-use these Maven dependencies using P2.

ctron
  • 538
  • 3
  • 13