ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Lalor <>
Subject how to convert path to fileset
Date Mon, 29 Mar 2004 12:48:14 GMT
Good morning, all.  I'm a relative Ant newbie and struggling a bit with 
the notion of paths and filesets.   I'd really like to be able to 
define a list of files that can be treated as either a path or a 
fileset so that I can limit the number of places I have to repeat 
things in my build descriptors.  Take, for example, trying to manage 
the entire set of libraries required for a project using Struts:

name="struts.home"	location="${user.home}/java/jakarta-struts-1.1" />

   <property name="commons-beanutils.jar" 
   <property name="commons-collections.jar" 
   <property name="commons-digester.jar" 
   <property name="commons-fileupload.jar" 
   <property name="commons-lang.jar" 
   <property name="commons-logging.jar" 
   <property name="commons-validator.jar" 
   <property name="jakarta-oro.jar" 
   <property name="struts.jar" value="${struts.home}/lib/struts.jar"/>

I need to add all of these to my compile path and my test, but I also 
need to bundle them with my .war.  So I start by putting 'em all into a 
   <!-- build up a path structure for easy reuse elsewhere -->
   <path id="struts.jars">
	<pathelement location="${commons-beanutils.jar}" />
	<pathelement location="${commons-collections.jar}" />
	<pathelement location="${commons-digester.jar}" />
	<pathelement location="${commons-fileupload.jar}" />
	<pathelement location="${commons-lang.jar}" />
	<pathelement location="${commons-logging.jar}" />
	<pathelement location="${commons-validator.jar}" />
	<pathelement location="${jakarta-oro.jar}" />
	<pathelement location="${struts.jar}" />

Now within my compile.classpath I can reference refid="struts.jars".  
But since I need to copy them to WEB-INF/lib, I would really like to 
just say
	<copy todir="${build.dir}/WEB-INF/lib">
		<some-reference-to refid="${struts.jars}" />

There doesn't seem to be a built-in way to do this, or an easy way to 
accomplish the transformation from path to fileset.

Has anyone already solved this problem?


Brian Lalor
Web Portal Analyst
Delta Faucet Co.
(v) 317-573-3461

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message