ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Karsten Wutzke" <>
Subject Return from task with BUILD SUCCESSFUL?
Date Fri, 11 Apr 2003 01:17:04 GMT
Hi all!

Is there any way in Ant to return from a target *successfully*, that is without printing "BUILD
FAILED"??? I would like a "BUILD SUCCESSFUL" message instead, so <fail> is no go.

I'm using an ant-contrib <trycatch> construct from inside an <if>, that simply
does some checking, and when an exception is caught, I want to print some information and
return from the task from inside the <catch>. Using <throw> from inside the <catch>
raises an exception in the IfTask class...

  <!-- Start local Tomcat -->
  <target name="start-local" depends="check-reach-local" description="Starts local Tomcat.">
        <isset property="local.unreachable"/>
            <fail message="Intentional fail forced! See message below."/>
            <echo message="Local Tomcat already running! Won't restart."/>
            <!--return/--> <!-- HOW? -->

  <echo message="Local Tomcat not running! Starting up..."/>

  <!-- START UP TOMCAT -->

  <echo message="Local Tomcat started up."/>


Any ideas? Stefan?


PS: Maybe an ant-contrib <return> task would help?
PPS: Sorry for the <no subject> mail before, please ignore it

UNICEF bittet um Spenden fur die Kinder im Irak! Hier online an
UNICEF spenden:

View raw message