Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7672295
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T16:15:10+00:00 2026-05-31T16:15:10+00:00

I have a doubt, I made this build file in order to build 3

  • 0

I have a doubt, I made this build file in order to build 3 different projects

<?xml version="1.0" encoding="UTF-8"?>
<project name="Trinity" basedir="." default="buildall">

   <target name="project1">
        <ant dir="C:/work/project1"/>
   </target>

   <target name="project2" depends="project1">
        <ant dir="C:/work/project2"/>
   </target>

   <target name="project3" depends="project1, project2">
        <ant dir="C:/work/project3"/>
   </target>

   <target name="buildall" depends="project3"/>

</project>

This is working now. But I wan to also clean the project before doing the build.

In fact I want to acomplish this:
C:/work/project1 ant clean build
C:/work/project2 ant clean build
C:/work/project3 ant clean build

Thanks in advance.

update: Thanks to the quick response from Alex I did a new build.xml file with the following. And I believe is working well, what do you think?.

<?xml version="1.0" encoding="UTF-8"?>
<project name="Trinity" basedir="." default="buildall">

   <target name="project1">
        <ant dir="C:/work/project1" target="clean"/>
        <ant dir="C:/work/project1" target="build"/>
   </target>

   <target name="project2" depends="project1">
        <ant dir="C:/work/project2" target="clean"/>
        <ant dir="C:/work/project2" target="build"/>
   </target>

   <target name="project3" depends="project1, project2">
        <ant dir="C:/work/project3" target="clean"/>
        <ant dir="C:/work/project3" target="build"/>
   </target>

   <target name="buildall" depends="project3"/>

</project>

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T16:15:11+00:00Added an answer on May 31, 2026 at 4:15 pm

    According to the ant task, you can specify the targets of the external ant build files

    <ant dir="C:/work/project1" target="clean build">
    

    Edit:

    According to the ant documentation:

    You can specify multiple targets using nested elements instead of using the target attribute. These will be executed as if Ant had been invoked with a single target whose dependencies are the targets so specified, in the order specified.

    So you can list out multiple targets this way:

    <ant dir="C:/work/project1">
        <target name="clean" />
        <target name="build" />
    </ant>
    

    Alternatively you can define a new target in the Project1,2,3 build.xml files called cleanBuild which will in turn call clean followed by build if you want to keep it as a single xml element <ant dir="C:/work/project1" target="cleanBuild">

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a doubt, sometime I made this conversion from DataTable to List<T> :
This is something that made me doubt for a while so I thought it
I have a simple doubt. I have made a custom ActionScript mxml component, which
I have a large application written using .Net remoting for file transfer. This was
i've made a php search engine a while ago and now i have this
I have doubt when i am reading difference resource for Proxy fetching or No-proxy
Possible Duplicate: What is the difference between const and readonly? i have doubt in
I have a doubt about orkut's new URL Writing method. Earlier the home page
I have one doubt regarding casting. public void Test(out T a, out T b)
I have a doubt in layouts.I have designed one layout using group layout using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.