Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » How to reference "Eclipse (user) libraries" from Ant script?
How to reference "Eclipse (user) libraries" from Ant script? [message #266047] Tue, 04 November 2008 16:47 Go to next message
Eclipse UserFriend
Originally posted by: cpet_magnus.hotmail.com

When I go in my current Eclipse project to properties->Java Build path->Libraries
then a couple of Libraries with *.jars files (e.g. for Hibernate) inside are listed.

When I compile the project with the Eclipse "Run as.." everything is fine.

Now I want to do the same with an Ant script in the projects base dir.
The problem is that this build.xml currently expects all the *.jars in the
\lib filder (which is not the case).

...
<property name="lib.dir" value="lib" />
<path id="project.classpath">
<fileset dir="${lib.dir}">
<include name="**/*.jar" />
<include name="**/*.zip" />
</fileset>
</path>

How can I refer from an Ant script to a "property" of the Eclipse project
and use the (user) library *.jars somewhere on my hard disc?

Do I really have to list all the jar files individually like

...
<property name="lib.dir" value="lib" />
<path id="project.classpath">
<fileset dir="${lib.dir}">
<include name="**/*.jar" />
<include name="**/*.zip" />
<include name="D:\test\proj23\Hibernate\aaaa.jar" />
....
</fileset>
</path>

I could imagine that there is a reference link possible like:

...
<property name="lib.dir" value="lib" />
<path id="project.classpath">
<fileset dir="${lib.dir}">
<include name="**/*.jar" />
<include name="**/*.zip" />
<include name="$(Eclipse)->$(UserLibraries)/Hibernate/*.jar" />
....
</fileset>
</path>

Camille
Re: How to reference "Eclipse (user) libraries" from Ant script? [message #663001 is a reply to message #266047] Fri, 01 April 2011 21:46 Go to previous message
Justin  is currently offline Justin Friend
Messages: 1
Registered: April 2011
Junior Member
Hi,

I know this is an old thread but I have the EXACT same question and any advice would be much appreciated.

I guess it comes down to, how do you make Eclipse's "User Libraries" play nice with Ant.

Is there a better approach than using a "User Library" to hole the multitude of jars needed for Hibernate?
Previous Topic:Installing Google SDK's failling
Next Topic:Java Dependencies
Goto Forum:
  


Current Time: Thu Apr 18 23:55:43 GMT 2024

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

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

Back to the top