ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject RE: non-Filelist list of jars
Date Thu, 02 Oct 2003 08:43:39 GMT
> I'm looking for a way to deal with a list of properties which specify 
> jars that I want to (a) include on a classpath and (b) copy 
> to a deploy 
> directory.
> I've got two files that I import:
> (1) puts the full pathname of jars into properties:
> xercesImpl.jar=D:/xerces-2_3_0/xercesImpl.jar
> xmlParserAPIs.jar=D:/xerces-2_3_0/xmlParserAPIs.jar
> jaxb-api.jar=F:/java/jwsdp-1.2/jaxb/lib/jaxb-api.jar
> (2) creates a property which is a list of some of those jars:
> external.jars=${commons-digester.jar},${commons-validator.jar}
> ,${jaxb-api.jar}
> When I've loaded 1 & 2, my ${external.jars} becomes a comma-seperated 
> list of jars with full pathnames.
> Now I want to use ${external.jars} as input for my compile 
> task, since 
> the jars I specify there all have to be on the classpath, and I also 
> want my deploy task to copy the jars listed in 
> ${external.jars} to the 
> deploy directory.

<path id="path">
    <pathelement path="${external.jars}"/>
<javac classpathref="path"/>

> You'll notice that in (1) the jars could be anywhere, i.e. 
> not relative 
> to one point on a harddrive, which rules out filelists and filesets.
> Can I iterate over my ${external.jars} in some way? Is there another 
> approach I could take?

AntContrib: <foreach list="${external.jars}"/>
foreach supports comma separated lists.

> The reason why I am doing this is essentially to allow different 
> projects and different developers to pick and choose the jars 
> they need 
> from a pre-prepared list (my first file 
> above), without 
> having to modify the build.xml tasks.

Aehmmm <deeply-thinking/> there was a discussion earlier about getting
libraries ... Maven has support for autodownload, and something on that
topic was discussed.


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message