ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: questions about classpath and FileSet
Date Tue, 16 Dec 2003 08:39:02 GMT
On Mon, 15 Dec 2003, Amy Cheung <> wrote:

> 1. two jars of the same name, one is on the system
> CLASSPATH and one in Javac's classpath attribute. When
> javac is run, which is used?

There are several factors that influence the outcome.  By default, the
one from javac's classpath will be found first.

If you set includeantruntime to true (the default), the system
CLASSPATH is appended to the task supplied <classpath>.  If it is
false, the system CLASSPATH is going to be ignored completely.

If you set the magic build.sysclasspath property, the rules change
completely, see <> for
the results.

> 2. can fileset's dir attribute takes a pattern instead
> of a specific directory? 


> our project has this file structure:
> top/componentA/X/src/a/b/c/some_java_files
> top/componentB/Y/src/a/b/c/some_java_files
> top/componentC/Z/src/a/b/c/some_java_files
> I want to copy all java files to a tmp directory and
> make it look like: tmp/a/b/c/all_java_fles
> But this didn't work: 
> <copy todir="tmp">
>   <fileset dir="top/**/src">
> </copy>

Use multiple filesets or a mapper.

<copy todir="tmp">
  <fileset dir="top" includes="*.java"/>
  <mapper type="regexp" from=".*/src/(.*)" to="\1"/>

should work (note, you need JDK 1.4 or Jakarta ORO or Jakarta Regexp
for the regexp mapper - ORO is recommended).


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

View raw message