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

On 01/22/2016 10:45 AM, Lee Carver 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 for replying.

I assume there's no harm in continuing to build the "repackaged libraries" module as part of the "hermetic" build (never heard someone use that in a sentence. :) ), it's just not going to change very often.

Could you please point out in this somewhat large "depan" project where these things are that we're referring to, where one module just has maven dependencies, and it's packaged as an OSGi module, and then this other part that I'm apparently missing?

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


Back to the top