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 6049511
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:35:06+00:00 2026-05-23T07:35:06+00:00

i have ant target which invokes simultaneously other 3 projects ant build target for

  • 0

i have ant target which invokes simultaneously other 3 projects ant build target for junit. this build target executes all three projects even though any one of the project build fails. Problem here is, if any one of the build fails error message should display after compiling three projects build target but it is not happening, how can i solve it?

<target name="mainbuild">
 <antcall target="junit-1">//in different project
 <antcall target="junit-2">//in different project
 <antcall target="junit-3">//in different project
<junitreport todir="./reports">
  <fileset dir="./project-1/reports">
    <include name="TEST-*.xml"/>
  </fileset>
  <fileset dir="./project-2/reports">
    <include name="TEST-*.xml"/>
  </fileset>
  <fileset dir="./project-3/reports">
    <include name="TEST-*.xml"/>
  </fileset>
  <report format="frames" todir="./report/html"/>
</junitreport>
</target>

<target name="junit-1">
.... do somethig 
</target>
<target name="junit-2">
.... do somethig 
</target>
<target name="junit-3">
.... do somethig 
</target>

1) main build invokes 3 project,even though build fail in any one of the sub project, build successful message displays at the end, it shouldn’t happen

2) if any one the sub project build fails, build report should generate, so that developer can analyze further on his failure.

  • 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-23T07:35:07+00:00Added an answer on May 23, 2026 at 7:35 am

    Since you have clarified that your targets are in different projects, i.e. different build files, you will have to use the ant or subant tasks instead of antcall. The subant task has a parameter called failonerror which you can set to false so that a failure will not stop the top-level build. I don’t know if it is possible to pass back to the top-level build the information that a sub-project build has actually failed its tests.

    If your targets were all in the same project you could change your junit tasks so that they don’t fail if a test fails, but instead set a property to indicate that a failure has occurred:

    <junit failureProperty="test.failed"> ... </junit>
    

    Then you can make your mainbuild target fail after generating the JUnit report:

    <fail if="test.failed"> ... </fail>
    

    I learned this from the book “Ant in Action”.

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

Sidebar

Related Questions

I have an ant target for creating zip like this - <zip destfile=${dist}/myzip.zip> <zipfileset
I have this ant script which should create the table customer. I see the
We have inherited an ant build file but now need to deploy to both
I have an ant target that echo's the content of an eclipse .project file,
I'm translating an Ant script to Maven 2 and I have this problem: the
I have the following in my pom: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-ant-plugin</artifactId> <version>2.3</version> <configuration> <target> <echo
I have an ant task set up like so: <target name=unit-test description=unit tests depends=compile-tests>
I have a build.xml which is capable of compiling and optimizing if I run
I have an Ant script that performs a copy operation using the 'copy' task
I have the problem that an specific step in Ant can only be executed

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.