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 09:47 AM, David M. Karr 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.

At this point, I think I want to focus on the build failure. The weird "(out of sync)" error in Eclipse appears to have gone away when I restarted Eclipse. I have no idea why.

So, in detail, what I'm seeing in the build is this:
------------------
[INFO] Resolving dependencies of MavenProject: com.cisco.yangide:com.cisco.yangide.core:1.1.1-SNAPSHOT @ .../yangide/plugins/com.cisco.yangide.core/pom.xml [INFO] {osgi.os=linux, osgi.ws=gtk, org.eclipse.update.install.features=true, osgi.arch=x86}
[ERROR] Cannot resolve project dependencies:
[ERROR]   Software being installed: com.cisco.yangide.core 1.1.1.qualifier
[ERROR] Missing requirement: com.cisco.yangide.core 1.1.1.qualifier requires 'bundle com.cisco.yangide.maventhirdparty 1.1.1' but it could not be found
----------------

At this point in the build, I already ran "mvn install" on the "com.cisco.yangide.maventhirdparty" project. I inspected the resulting jar and manifest, and it seems fine.

If Tycho is "missing requirement X", where exactly is it looking, and can I make it be more verbose about what it's looking at?

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.



Back to the top