how can I do it in Ant environment? It's pretty ugly (especially since I need to ensure that our script runs on non-windows platforms as well), but it will do. I am able to report the build as failure which is what i wanted. can you provide the script that runs the Ant build task?
Browse other questions tagged ant build or ask your own question. Guy Roth Ranch Hand Posts: 74 posted 7 years ago Anyone? My .bat file is like below: call ant -buildfile task.xml target1 call ant -buildfile task.xml target2 For each ant task, it will execute a java program and the program will return You can use that to run a program if it exists, but otherwise do nothing.
But if you want it to be part of Ant, then you could you either of these 2 ways: 1) Use the Log4jListener http://ant.apache.org/manual/listeners.html#Log4jListener which will log the task message to Edit: Alternatively, there is an article here that describes a workaround with a macrodef share|improve this answer edited Mar 14 '14 at 19:26 answered Mar 14 '14 at 17:20 Slav 15.1k33161 Post Reply Bookmark Topic Watch Topic New Topic programming forums Java Java JSRs Mobile Certification Databases Caching Books Engineering Languages Frameworks Products This Site Careers Other all forums Forum: Ant, Maven No timeout Stop the command if it doesn't finish within the specified time (given in milliseconds).
You can follow any comments to this entry through the RSS 2.0 feed. Ant Execute Shell Script Get to work, and may the build force be with you! 🙂 This entry was posted on Friday, October 24th, 2008 at 13:59 and is filed under ant, howto, shell, tutorials. Either there is something wrong with the version of Ant you are using, or (most likely) something wrong with the batch file. http://stackoverflow.com/questions/4344139/how-to-get-a-return-value-from-an-exec-in-ant-script Any file mapping is done using a null sourcefile; therefore not all Mapper types will return results.
Alternatively, you can set resultproperty to the name of a property and have it assigned to the result code (barring immutability, of course). ANT may very well be behaving correctly :-) –Mark O'Connor Feb 21 '13 at 19:48 added the ant code –cmcginty Feb 22 '13 at 20:23 add a comment| Your Ant Resultproperty Construction of an optimal electron cage i am confused about a gerund verb (having) Ways to tell a person to be quiet Ordering a list of strings Which plural to use Ant Command Line Arguments share|improve this answer edited Jul 20 '11 at 9:14 answered Jul 20 '11 at 8:26 martin clayton 54.5k13162162 OK another thing is, what can i do in ANT Build.xml
Alternatively, you can set resultproperty to the name of a property and have it assigned to the result code (barring immutability, of course). since Ant 1.6 No append Whether output and error files should be appended to or overwritten. No error The file to which the standard error of the command should be redirected. echo "ANT: Return code is: \""$antReturnCode"\"" if [ $antReturnCode -ne 0 ];then echo "BUILD ERROR: I am failing hard..." exit 1; else echo "GREAT SUCCESS: Niiice - I Ant Exec Outputproperty
more stack exchange communities company blog Stack Exchange Inbox Reputation and Badges sign up log in tour help Tour Start here for a quick overview of the site Help Center Detailed posted 7 years ago Guy, There's a concept called a logger that can send an e-mail with the results. The soul is dyed the color of its thoughts. Dirac delta function and correlation functions I accepted a counter offer and regret it: can I go back and contact the previous company?
WiringPi: change output of GPIO pins synchronously? Ant Exec Task Example No failonerror Stop the buildprocess if the command exits with a return code signaling failure. Convince people not to share their password with trusted others I accepted a counter offer and regret it: can I go back and contact the previous company?
I'll try to be clearer: I am using the command line: ant -f build.xml -logger org.apache.tools.ant.listener.MailLogger -logfile log/build.log acm.nightly where: acm.nightly is our specific build task and in addition defined the Similarly, error output is sent to a file and a property, both named "redirector.err". deprecated, use executable and nested
We're back to the original suggestions - write your own logger or write an operating system script. Not the answer you're looking for? Can filling up a 75 gallon water heater tank without opening a faucet cause damage? Howto prevent chrgrp from clearing “setuid bit”?
Great! Liquids in carry on, why and how much? At the start I am blaringly obvious Are HTTP brute force attacks a thing nowadays How could banks with multiple branches work in a world without quick communication? How did Samba, Krishna's son, get relieved from Curse of Krishna?
Not the answer you're looking for? The target name that does that is "check-duplicate-jars": build.xml:
Fail Description Exits the current build (just throwing a BuildException), optionally printing additional information. Guy Roth Ranch Hand Posts: 74 posted 7 years ago I would like to be able to send mail (for example) whenever the Ant build process fails. Cygwin Users The