|
Re: How can I cause a Java Build Path Library to resolve a new Jar added Programatically? [message #243337 is a reply to message #243323] |
Tue, 01 May 2007 20:22 |
Eclipse User |
|
|
|
Originally posted by: wharley.bea.com
"jkenny" <jkenny3112000@yahoo.com> wrote in message
news:f17v3d$qdt$1@build.eclipse.org...
> My Eclipse plugin has a builder which adds a jar file to a Project with
> the Java Nature. The Java Project has a Java Build Path Library entry for
> a lib folder in the project so that I can add jars to the lib dir and not
> have to manually add them individually to the java build path.
>
> [...]
>
> Does anyone know how I can manually "kick" the Java Build path to see the
> jar I added to the lib dir so it gets added to the classpath?
Yes, you're going to have problems whenever you try to modify a project's
inputs from within the build. Adding a jar file to the classpath within the
context of a build is sort of like in-flight refueling, a tricky
proposition.
You'd be better off if you can avoid it altogether; perhaps you can use a
ResourceChangeListener, or perhaps do it within a custom project creation
wizard, rather than trying to do it on the fly.
If you must do it on the fly, you might want to think about adding a
ClasspathContainer, with dynamic contents. But I'll caution you that that's
the approach taken by some of the WTP components and it has been problematic
because of issues with classpath containers not being fully resolved in
time.
|
|
|
|
Powered by
FUDForum. Page generated in 0.04273 seconds