Here is my build.xml <?xml version="1.0" encoding="iso-8859-1"?> <project name="dev" default="all" basedir="."> <property file="./application.properties"/> <property name="failonerror" value="true" /> <taskdef resource="net/sf/antcontrib/antcontrib.properties"/> <taskdef resource = "net/sf/antcontrib/antlib.xml"/> <target name="deploy-application-testnet-dr"> <for list="${name.list}" param="sourceappname" keepgoing="true"> <sequential> <antcall target="deploy-now-on-testnet-dr" inheritall="true"> <param name="sourceappname" value="@{sourceappname}"/> </antcall> </sequential> </for> </target> <target name="deploy-now-on-testnet-dr"> <propertycopy name="file" from="${sourceappname}.file" silent="true"/> <propertycopy name="name" from="${sourceappname}.name" silent="true"/> <propertycopy name="type" from="${sourceappname}.type" silent="true"/> <input message="Do you want to deploy ${name} to TESTNET-DR? " validargs="y,n" addproperty="user.selection" /> <condition property="do.abort"> <equals arg1="n" arg2="${user.selection}"/> </condition> <fail if="do.abort"> ***** You have chosen not to deploy ${file}. *****</fail> <!-- tasks to deploy the app --> <java classname="weblogic.Deployer" fork="true" maxmemory="256m" failonerror="true"> . . . . </java> </target>
Shailesh Sharma <[EMAIL PROTECTED]> wrote: I am still looking for a solution. Iam using foreach task. and i loop through it and it ask Y/N as an input. But if I select Y for the first input, for the second input, i have to press Y twice. any solution so far on this? Shailesh Sharma wrote: I am using foreach task as you suggest previously with an example. it works except that when i select "Y" for my first selection of the file deployment, the next gives me an option to select "Y/N" ... BUT when select either Y/N ...it does not work. If i press enter again, it ask me to select Y/N for the second time ...and NOW it works (depending upon whatever i choose Y/N). So, the second selection for my files works after 2 times of acceptance. "Anderson, Rob (Global Trade)" wrote: Are you still having problems with this? You need to use the foreach task, rather than the for task. -Rob Anderson > -----Original Message----- > From: Shailesh Sharma [mailto:[EMAIL PROTECTED] > Sent: Monday, April 02, 2007 7:32 AM > To: Ant Users List > Subject: RE: Problem with condition selection property; Help needed > > I am using following: > > Apache Ant version 1.6.2 compiled on August 5 2004 > > > > Shailesh Sharma wrote: > I am getting following errors now ... > > > BUILD FAILED > /export/bea/Mah-ail/AIL/AOCB/scripts/build.xml:174: The type > doesn't support the "keepgoing" attribute. > > > > "Anderson, Rob (Global Trade)" wrote: > OK. I think I understand what you are trying to do. I would > suggest using the task, rather than the task, because the > task has a keepgiong attribute. > > Here is a solution that works for me. > > > > > > > > > > > > > > [input] validargs="y,n" addproperty="user.selection"/> > > > > > ******* You have chosen not to deploy > ${sourceappname.a}. ***** > Deploying ${sourceappname.a} > > > > > -Rob Anderson > > > > > -----Original Message----- > > From: Shailesh Sharma [mailto:[EMAIL PROTECTED] > > Sent: Thursday, March 29, 2007 7:54 AM > > To: Ant Users List > > Subject: RE: Problem with condition selection property; Help needed > > > > Rob, Thanks for atleast writing something. I am still having that > > problem. > > > > Actually this is the scenario: > > > > I am using this build to deploy my application ear files. I > have 3 ear > > files in total. But it could sometimes be less or more than 3. So, > > this build is a generic script. > > > > Basically, every time when i deploy my application ear file, this > > build ask me for a selection "Y/N" -- when i accept "Y" it > deploy that > > particular file, then it ask me for the next and so on so forth. > > > > But when i accept "N" as a selection for the first ear > file, it just > > comes out as "build failed". I do not want that. I want to > move on to > > the next ear file for me to get selection "Y/N" again till > i ran out > > of my number of ear files IRRESPECTIVE of me selecting "N" for > > particular ear files( that i do not want to deploy momentarily). > > > > Please advise and let me know how to change the logic. > > > > > > "Anderson, Rob (Global Trade)" wrote: > > Shailesh, When fail is executed, the build fails. What are you > > expecting to happen? > > > > -Rob Anderson > > > > > > > > > -----Original Message----- > > > From: Shailesh Sharma [mailto:[EMAIL PROTECTED] > > > Sent: Monday, March 26, 2007 7:01 PM > > > To: Ant Users List > > > Subject: Re: Problem with condition selection property; > Help needed > > > > > > I am still scratching my head on my problem. Any help is > much much > > > appreciated. > > > > > > Best Regards. > > > > > > > > > Shailesh Sharma wrote: > > > Hi, > > > I have a "for loop" in one target that iterates through few times > > > and then call my actual deployment target". > > > > > > The problem is that when I accept "n" (i.e NO) as the first > > > selection, the whole build just comes out of the loop and do not > > > allow me to choose selection for the rest of the files in > the "for > > > loop". > > > > > > Please help. > > > > > > Exception: > > > > > > BUILD FAILED > > > file:/export/bea/Win-splus/SPLUS/QPS/scripts/build.xml:62: > > > ******* You have choosen not to continue. Build aborted by user. > > > ******* > > > > > > > > > Following is snippet of my build.xml file ... > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > [input] message="Aceepy either y or n to continue and then press > > > enter" > > > > > > validargs="y,n" > > > addproperty="user.selection" > > > /> > > > > > > > > > > > > > > > > > > ******* You have choosen not to continue. Build aborted by user. > > > ******* > > > > > > . > > > . > > > . > > > . > > > .. > > > > > > > > > > > > > > > > > > > > > --------------------------------- > > > Bored stiff? Loosen up... > > > Download and play hundreds of games for free on Yahoo! Games. > > > > > > > > > --------------------------------- > > > Expecting? Get great news right away with email Auto-Check. > > > Try the Yahoo! Mail Beta. > > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] For > additional > > commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > --------------------------------- > > Sucker-punch spam with award-winning protection. > > Try the free Yahoo! Mail Beta. > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] For > additional commands, e-mail: [EMAIL PROTECTED] > > > > > --------------------------------- > No need to miss a message. Get email on-the-go with Yahoo! > Mail for Mobile. Get started. > > > --------------------------------- > Expecting? Get great news right away with email Auto-Check. > Try the Yahoo! Mail Beta. > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------- Food fight? Enjoy some healthy debate in the Yahoo! Answers Food & Drink Q&A. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com