Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » how to programatically resolve .classpath entries
how to programatically resolve .classpath entries [message #629491] Tue, 28 September 2010 13:26 Go to next message
cam_neely  is currently offline cam_neely Friend
Messages: 1
Registered: September 2010
Junior Member
Hi,
I have not been able to get any results in prior searches, so I thought I'd post and see if someone could help.

We are trying to make our build dynamic so we don't have to hard-code dependent jars.

What we are trying to do is take advantage of the .classpath file to build a list of the jar dependencies of the project. But with the variables in that file, it becomes impossible without then hard-coding the variable value.

i.e. :
<classpathentry kind="var" path="SOME_EXTERNAL_LIB/some-jar.jar"/>


how to resolve SOME_EXTERNAL_LIB?

Is there a way to do this programatically by hooking into some Eclipse API class?

Thanks
Re: how to programatically resolve .classpath entries [message #632474 is a reply to message #629491] Wed, 13 October 2010 06:01 Go to previous message
Walter Harley is currently offline Walter HarleyFriend
Messages: 847
Registered: July 2009
Senior Member
cam_neely wrote:
> Hi,
> I have not been able to get any results in prior searches, so I thought
> I'd post and see if someone could help.
>
> We are trying to make our build dynamic so we don't have to hard-code
> dependent jars.
>
> What we are trying to do is take advantage of the .classpath file to
> build a list of the jar dependencies of the project. But with the
> variables in that file, it becomes impossible without then hard-coding
> the variable value.
>
> i.e. :
> <classpathentry kind="var" path="SOME_EXTERNAL_LIB/some-jar.jar"/>
>
> how to resolve SOME_EXTERNAL_LIB?
>
> Is there a way to do this programatically by hooking into some Eclipse
> API class?
>
> Thanks

You may want to look into Ivy or Maven to manage your dependencies.

But anyway, yes, the JDT exposes methods like IJavaProject.getClasspath() that
can do what you want. (Compare with getRawClasspath(), which does not resolve
the variables.)

Or, you can launch Eclipse itself, headless (no UI) to do your build.
Previous Topic:Line Number of IField, IType declarations?
Next Topic:How to Get the Little Check Mark next to a Breakpoint
Goto Forum:
  


Current Time: Thu Apr 25 09:20:01 GMT 2024

Powered by FUDForum. Page generated in 0.03232 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top