ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Laurie Harper <>
Subject Re: Building Multiple Projects with one build.xml
Date Thu, 29 Aug 2002 23:35:24 GMT
I'm trying to solve the same problem and have it mostly working; the only
problem I can't solve is to allow a task for one sub-project depend on a
task for another.

Apart from that, it's pretty easy. Just use a build.xml that loads a
properties file and make all your worker tasks use properties exclusively.
For example:

    <project name="master build" default="all">
        <properties file="${}/>

        <target name="all" depends="compile,jar,..."/>

            <classpath id="classpath">
                <fileset dir="${dir.lib}">
                    <include name="**/*.jar"/>

        <target name="compile" depends="init">



Invoke ant with 

    ant ...

Each component's properties file defines properties the build.xml needs, for

You could get fancy by using ant-contrib's 'foreach' class to build all of
your components by searching for their properties files.


On 8/28/02 10:24 AM, "Michael Baker" <> wrote:

> Hi everybody.
> I have many Java projects with many separated build.xmls.  I would like to
> create a template build.xml that uses a property file for necessary
> properties.
> My question.  Is it possible to call the jar task many times based on a set of
> properties?  I would like to be able to build all of my Java projects with one
> build.xml and one property file.  I am familiar with setting up the property
> file, but not sure what to do in build.xml (I only want to have one javac
> task, jar task, etc).
> In a scripting language I would:
> for each property (in jar section of file)
>  create jar 
> next
> Is this possible in Ant?
> Thanks for any help.
> Mike

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

View raw message