|Get Eclipse PDE to automatically use jars specified in build-classpath in manifest [message #1726372]
||Fri, 11 March 2016 22:01
| David M. Karr
Registered: July 2009
I have an Eclipse plugin codebase consisting of several plugins, a target platform, product, and update site. It has a Maven build script using Tycho.|
When I originally got a hold of this codebase, one of the plugins had a "lib" folder where a handful of dependencies needed by the plugin were stored directly in the project, and the "build-classpath" property in the manifest specified the path to those jars. I hadn't even noticed this initially, as Eclipse didn't complain, so I'm assuming it was properly referencing those jars.
I recently had to change this somewhat so the artifacts were specified declaratively, instead of storing them directly in the project. I removed the "hard-stored" jars and added a declaration of the "copy" goal from the "maven-dependency-plugin" to copy those desired artifacts to a "libs" folder (changing the name to be sure I was clear on what was referencing this structure).
This actually worked perfectly fine. The jars are now not stored in the project, they're just produced at build time, even though the result at runtime is almost identical.
Now I'm looking at what I see in Eclipse with this changed structure. It appears that Eclipse, even using the PDE, doesn't fully recognize that there are required dependencies in that "libs" folder, as specified by the "build-classpath" property in the manifest. I'm getting compile errors in the source files that reference those classes, even though I can see those jars right in the project.
I ended up doing the only thing I could see, which was manually editing the "Build Path" section of the project preferences, and manually adding those jars as libraries. This fixes the problem, but it's not very clean in my view.
Is there something I'm missing that would have allowed Eclipse to automatically add those jars as dependencies?
Powered by FUDForum
. Page generated in 0.02262 seconds