Take the 2-minute tour ×

I am currently working on a project that involves many subprojects that all have the same directory structure. I would like to setup a system where I can run ant build and ant will go through each folder and run it's target on each of the folders.

There are multiple tasks like this besides compiling that I need to execute on each of the subprojects.

Does there already exist a method to handle this? Do I need to resort to scripting solutions?


share|improve this question
You should consider using Maven builds. In my experience, ANT scripts are evil if greater than 2 pages, and really evil, when they call each other. –  Gábor Lipták Nov 10 '10 at 12:26
I've always wondered about Maven. For this case specifically, how would having Maven builds help? –  Sandro Nov 10 '10 at 21:53
add comment

1 Answer

up vote 4 down vote accepted

look here good tutorial http://www.javaranch.com/journal/200603/AntPart1.html But in summary the subAnt task should work

share|improve this answer
Perfect! That is exactly what I was looking for. –  Sandro Nov 10 '10 at 4:03
add comment

Your Answer


