Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] Need help replacing "hard-stored" jars with maven dependencies

David -

You'll probably also want to set up a PDE Target Platform, especially for those modules (e.g. Guava, slf4j?) that are OSGi compliant from MavenCentral.  I found that Eclipse/m2e would load the repackaged modules through Maven dependencies, but not the ones that are already OSGi compliant.

The tidiest solution that I found was a Maven project that copies these OSGi compliant libraries into a target/ area based on the Maven ID.  It's straightforward to add the contents of the target/ directory to your Target Platform, and you don't have to check-in the library modules into your version control system.

On Fri, Jan 22, 2016 at 10:45 AM, Lee Carver <leeca@xxxxxxxxxxx> wrote:
Hi David -

I've found I need to do this in two Maven build steps.  The first step builds the re-packaged third-party libraries as OSGi compliant modules.  A second Maven build takes care of all the OSGi assembly and Eclispe RCP application generation.  I tend to run the first step only when setting up a new machine (or build process).  Only the second Maven build happens as part of the recurring development cycle.  

Since the repackaged libraries to be very stable, there is limited value forcing it into a monolithic system build.  Most builds will only ever need to update the team's added Eclipse code.  For those rare cases where you really need a hermetic build from scratch, you've probably got a shell script that can handle two Maven invocations anyway.

You can see my solution to this at the DepAn project (  Let me know if you have any questions.

- Lee

On Fri, Jan 22, 2016 at 9:47 AM, David M. Karr <davidmichaelkarr@xxxxxxxxx> wrote:
I inherited a large open-source Eclipse plugin codebase.  I'm a long-time Java dev, but very new to Eclipse app/plugin development.

The current state of the build is fine, but I discovered an issue that I have to fix, and I'm having lots of trouble with it.

If it matters, you can see the existing state of the code at (branch "forkmaster").

I discovered that one of the modules has a "lib" folder with a handful of stored jars.  I have to remove these jars and replace this with declarative dependencies.  I noticed that the "slf4j" jar is available in the Eclipse p2 repo, so that should be easy to replace.  The others are harder.  The two "yang" artifacts are available in a public maven repo that I can reach.  The "mapdb" and "antlr4" artifacts are available on Maven Central.

I understand that a single "reactor build" can either get p2 dependencies, or Maven dependencies, but not both in the same build.  I assume a "reactor build" corresponds to a single project defined by a "pom.xml" file.  I would also assume that a single "reactor build" could be part of a multi-module build, where the other modules only get p2 dependencies.

I've gotten other feedback on this problem, like "this is supposed to be possible, but I never got it to work".

I've gotten some help on this problem from the eclipse-dev mailing list (I only just now discovered tycho-user), which is how I found the following page: . I noted on the eclipse-dev mailing list some issues with this page that indicate it is somewhat out of date.

>From this advice, I added a new module that just references the jars with Maven GAV coords and with a manifest that exports the required packages.  This seems to build by itself, but I don't know if this is what I need.

There are still issues that I don't understand.  I posted the following on the Eclipse forum that illustrates my current problems: .

I see the "(out of sync)" thing with an error marker when I try to add the new module as a dependency of the original module that had the "lib" folder.  Someone else saw the same thing several years ago (referenced in the posting), but the "simple" fix hasn't made a difference.

I also see the build failing, as it's not able to find the new module.  I don't know if this is related to the "(out of sync)" problem, or something independent.

Some people have said that perhaps I need to add the new module to my target platform.  I'm not convinced that makes any sense. Another of my existing plugins references two of the other existing plugins as dependencies.  I would think that would be what I need here, as opposed to changing the target platform.  In any case, I tried seeing how to add this new module to the target platform, but I don't see a way to do that.
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit

Back to the top