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

The depan-osgi-library/ does most of the heavy-lifting for Guava and Joda time.  YMMV.

Gotta run .. happy to answer more questions in a couple hours

On Fri, Jan 22, 2016 at 11:02 AM, David M. Karr <davidmichaelkarr@xxxxxxxxx> wrote:


On 01/22/2016 10:55 AM, Lee Carver wrote:
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 application already has a target platform definition.  I noticed that slf4j is already available in one of the p2 repos there, so that one will be easy.  The others are harder. I don't fully understand the last sentence (not that I understand target platforms that well either).

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.

Could you please elaborate?  I don't know what to do with this.  Are you doing this in "depan" somewhere?

I did manage to answer part of my question about what you're doing in "depan".  I did find the four libraries with maven dependencies and the "maven-bundle-plugin" reference.  I just don't understand the other parts, that make this available for other plugins to depend on.





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 (https://github.com/google/depan).  Let me know if you have any questions.

Thanks
- 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 https://github.com/davidmichaelkarr/yang-ide.git (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: https://wiki.eclipse.org/Tycho/How_Tos/Dependency_on_pom-first_artifacts . 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: https://www.eclipse.org/forums/index.php/t/1074071/ .

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
tycho-user@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user




_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user


_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user


Back to the top