how to do conditional processing in ant
Hi Friends, I know how to pass more than one command line arguments /parameters to a task in ant. Ex: Command prompt>ant –Denvv=production -Dssltype=1SSL eardirect ( where eardirect is a task name I defined in ant) Assume I have four different environments like PROD, SIT, UAT & DEV and I can access each environment in 2 different ways like 1 way SSL & 2 way SSL. So user may give envv from PROD/SIT/UAT/DEV and ssltype from 1SSL/2SSL. Now my requirement is “ based on user parameters like envv=production & ssltype=1SSL, I need to copy some files from xyz/1ssl/ folder to xyz/ folder” here I should use some conditional logic. Is there any coretask available in ANT to do this ? Please help regarding the same. Thanks in advance. Regards, Edumudi Venkata Viswanath | Associate Consultant | | +91 20 3984 7491 (O) | 9665045854 (M) Oracle Financial Services Software Limited | Ambrosia, Pune, India Oracle Financial Services Software Limited was formally i-flex solutions limited.
RE: how to do conditional processing in ant
Conditional copy of files from a directory XYZ/prod/1ssl to xyz/ directory. -Original Message- From: Scot P. Floess [mailto:sflo...@nc.rr.com] Sent: Friday, July 17, 2009 8:06 PM To: Ant Users List Subject: Re: how to do conditional processing in ant Do you need to conditionally copy files or copy files based on a dir defined in a property? On Fri, 17 Jul 2009, edumudi.viswan...@oracle.com wrote: > Hi Friends, > > > > I know how to pass more than one command line arguments /parameters to a task > in ant. > > Ex: Command prompt>ant -Denvv=production -Dssltype=1SSL eardirect >( where eardirect is a task name I defined in ant) > > > > Assume I have four different environments like PROD, SIT, UAT & DEV and I can > access each environment in 2 different ways like 1 way SSL & 2 way SSL. So > user may give envv from PROD/SIT/UAT/DEV and ssltype from 1SSL/2SSL. > > > > Now my requirement is " based on user parameters like envv=production & > ssltype=1SSL, I need to copy some files from xyz/1ssl/ folder to xyz/ > folder" here I should use some conditional logic. Is there any coretask > available in ANT to do this ? > > > > Please help regarding the same. > > > > Thanks in advance. > > > > Regards, > > Oracle logo.gif > > Edumudi Venkata Viswanath | Associate Consultant | | +91 20 3984 7491 (O) | > 9665045854 (M) > Oracle Financial Services Software Limited | Ambrosia, Pune, India > > > > Oracle Financial Services Software Limited was formally i-flex solutions > limited. > > > > Scot P. Floess 27 Lake Royale Louisburg, NC 27549 252-478-8087 (Home) 919-890-8117 (Work) Chief Architect JPlate http://sourceforge.net/projects/jplate Chief Architect JavaPIM http://sourceforge.net/projects/javapim Architect Keros http://sourceforge.net/projects/keros - To unsubscribe, e-mail: user-unsubscr...@ant.apache.org For additional commands, e-mail: user-h...@ant.apache.org - To unsubscribe, e-mail: user-unsubscr...@ant.apache.org For additional commands, e-mail: user-h...@ant.apache.org
RE: how to do conditional processing in ant
Assume, below folder structure & I issue following command @ command prompt: ant -Denvv=sit -Dssltype=1SSL eardirect Xyz folder contains (dev,prod,sit,uat) Dev folder contains (1ssl & 2ssl) 1ssl folder contains 1.txt 2.txt 2ssl 1.txt 2.txt Sit folder contains 1ssl folder contains 1.txt 2.txt 2ssl 1.txt 2.txt Prod folder contains 1ssl folder contains 1.txt 2.txt 2ssl 1.txt 2.txt Uat folder contains 1ssl folder contains 1.txt 2.txt 2ssl 1.txt 2.txt Now, based on given envv & ssltype, it should copy files from xyz/sit/1ssl to xyz/. To do this copy task, ant must use some kind of conditional processing. Based on that decision, It needs to copy files from that particular folder to xyz folder. -Original Message- From: Scot P. Floess [mailto:sflo...@nc.rr.com] Sent: Friday, July 17, 2009 8:39 PM To: Ant Users List Subject: RE: how to do conditional processing in ant Well it seems to me you are really trying to copy files as denoted by a property - is this correct? So, for example lets say you do this: ant -Denvv=production -Dssltype=1SSL eardirect or ant -Denvv=sit -Dssltype=1SSL eardirect Are you wanting then to copy like so: Or am I missing something? On Fri, 17 Jul 2009, edumudi.viswan...@oracle.com wrote: > Conditional copy of files from a directory XYZ/prod/1ssl to xyz/ directory. > > -Original Message- > From: Scot P. Floess [mailto:sflo...@nc.rr.com] > Sent: Friday, July 17, 2009 8:06 PM > To: Ant Users List > Subject: Re: how to do conditional processing in ant > > > Do you need to conditionally copy files or copy files based on a dir > defined in a property? > > > > On Fri, 17 Jul 2009, edumudi.viswan...@oracle.com wrote: > >> Hi Friends, >> >> >> >> I know how to pass more than one command line arguments /parameters to a >> task in ant. >> >> Ex: Command prompt>ant -Denvv=production -Dssltype=1SSL eardirect >> ( where eardirect is a task name I defined in ant) >> >> >> >> Assume I have four different environments like PROD, SIT, UAT & DEV and I >> can access each environment in 2 different ways like 1 way SSL & 2 way SSL. >> So user may give envv from PROD/SIT/UAT/DEV and ssltype from 1SSL/2SSL. >> >> >> >> Now my requirement is " based on user parameters like envv=production & >> ssltype=1SSL, I need to copy some files from xyz/1ssl/ folder to xyz/ >> folder" here I should use some conditional logic. Is there any coretask >> available in ANT to do this ? >> >> >> >> Please help regarding the same. >> >> >> >> Thanks in advance. >> >> >> >> Regards, >> >> Oracle logo.gif >> >> Edumudi Venkata Viswanath | Associate Consultant | | +91 20 3984 7491 (O) | >> 9665045854 (M) >> Oracle Financial Services Software Limited | Ambrosia, Pune, India >> >> >> >> Oracle Financial Services Software Limited was formally i-flex solutions >> limited. >> >> >> >> > > Scot P. Floess > 27 Lake Royale > Louisburg, NC 27549 > > 252-478-8087 (Home) > 919-890-8117 (Work) > > Chief Architect JPlate http://sourceforge.net/projects/jplate > Chief Architect JavaPIM http://sourceforge.net/projects/javapim > > Architect Keros http://sourceforge.net/projects/keros > > - > To unsubscribe, e-mail: user-unsubscr...@ant.apache.org > For additional commands, e-mail: user-h...@ant.apache.org > > > > - > To unsubscribe, e-mail: user-unsubscr...@ant.apache.org > For additional commands, e-mail: user-h...@ant.apache.org > > Scot P. Floess 27 Lake Royale Louisburg, NC 27549 252-478-8087 (Home) 919-890-8117 (Work) Chief Architect JPlate http://sourceforge.net/projects/jplate Chief Architect JavaPIM http://sourceforge.net/projects/javapim Architect Keros http://sourceforge.net/projects/keros - To unsubscribe, e-mail: user-unsubscr...@ant.apache.org For additional commands, e-mail: user-h...@ant.apache.org - To unsubscribe, e-mail: user-unsubscr...@ant.apache.org For additional commands, e-mail: user-h...@ant.apache.org
FW: how to do conditional processing in ant
Assume, below folder structure & I issue following command @ command prompt: ant -Denvv=sit -Dssltype=1SSL eardirect Xyz folder contains (dev,prod,sit,uat) Dev folder contains (1ssl & 2ssl) 1ssl folder contains 1.txt 2.txt 2ssl 1.txt 2.txt Sit folder contains 1ssl folder contains 1.txt 2.txt 2ssl 1.txt 2.txt Prod folder contains 1ssl folder contains 1.txt 2.txt 2ssl 1.txt 2.txt Uat folder contains 1ssl folder contains 1.txt 2.txt 2ssl 1.txt 2.txt Now, based on given envv & ssltype, it should copy files from xyz/sit/1ssl to xyz/. To do this copy task, ant must use some kind of conditional processing. Based on that decision, It needs to copy files from that particular folder to xyz folder. My basic question are how ant will do this conditional processing before copying files? If it possible with ant, by which we can achieve this? -Original Message- From: Scot P. Floess [mailto:sflo...@nc.rr.com] Sent: Friday, July 17, 2009 8:39 PM To: Ant Users List Subject: RE: how to do conditional processing in ant Well it seems to me you are really trying to copy files as denoted by a property - is this correct? So, for example lets say you do this: ant -Denvv=production -Dssltype=1SSL eardirect or ant -Denvv=sit -Dssltype=1SSL eardirect Are you wanting then to copy like so: Or am I missing something? On Fri, 17 Jul 2009, edumudi.viswan...@oracle.com wrote: > Conditional copy of files from a directory XYZ/prod/1ssl to xyz/ directory. > > -Original Message- > From: Scot P. Floess [mailto:sflo...@nc.rr.com] > Sent: Friday, July 17, 2009 8:06 PM > To: Ant Users List > Subject: Re: how to do conditional processing in ant > > > Do you need to conditionally copy files or copy files based on a dir > defined in a property? > > > > On Fri, 17 Jul 2009, edumudi.viswan...@oracle.com wrote: > >> Hi Friends, >> >> >> >> I know how to pass more than one command line arguments /parameters to a >> task in ant. >> >> Ex: Command prompt>ant -Denvv=production -Dssltype=1SSL eardirect >> ( where eardirect is a task name I defined in ant) >> >> >> >> Assume I have four different environments like PROD, SIT, UAT & DEV and I >> can access each environment in 2 different ways like 1 way SSL & 2 way SSL. >> So user may give envv from PROD/SIT/UAT/DEV and ssltype from 1SSL/2SSL. >> >> >> >> Now my requirement is " based on user parameters like envv=production & >> ssltype=1SSL, I need to copy some files from xyz/1ssl/ folder to xyz/ >> folder" here I should use some conditional logic. Is there any coretask >> available in ANT to do this ? >> >> >> >> Please help regarding the same. >> >> >> >> Thanks in advance. >> >> >> >> Regards, >> >> Oracle logo.gif >> >> Edumudi Venkata Viswanath | Associate Consultant | | +91 20 3984 7491 (O) | >> 9665045854 (M) >> Oracle Financial Services Software Limited | Ambrosia, Pune, India >> >> >> >> Oracle Financial Services Software Limited was formally i-flex solutions >> limited. >> >> >> >> > > Scot P. Floess > 27 Lake Royale > Louisburg, NC 27549 > > 252-478-8087 (Home) > 919-890-8117 (Work) > > Chief Architect JPlate http://sourceforge.net/projects/jplate > Chief Architect JavaPIM http://sourceforge.net/projects/javapim > > Architect Keros http://sourceforge.net/projects/keros > > - > To unsubscribe, e-mail: user-unsubscr...@ant.apache.org > For additional commands, e-mail: user-h...@ant.apache.org > > > > - > To unsubscribe, e-mail: user-unsubscr...@ant.apache.org > For additional commands, e-mail: user-h...@ant.apache.org > > Scot P. Floess 27 Lake Royale Louisburg, NC 27549 252-478-8087 (Home) 919-890-8117 (Work) Chief Architect JPlate http://sourceforge.net/projects/jplate Chief Architect JavaPIM http://sourceforge.net/projects/javapim Architect Keros http://sourceforge.net/projects/keros - To unsubscribe, e-mail: user-unsubscr...@ant.apache.org For additional commands, e-mail: user-h...@ant.apache.org - To unsubscribe, e-mail: user-unsubscr...@ant.apache.org For additional commands, e-mail: user-h...@ant.apache.org
how can stop build proccess in a sub task?
I have target like , which depends on sub_task1, sub_task2. So subtasks are &
how to change name of war & ear file based on user input values
Hi, I have an build.xml file. If I run the target "ear-target" using ant -Dxyz=1 -Dyyy=1 ear-target@ command prompt, it should create webpro11.ear & webpro11.war & if I run "ear-target" using ant -Dxyz=1 -Dyyy=2 ear-target@ command prompt, it should create webpro12.ear & webpro12.ear How can I achieve this ? Any idea? Thanks in adavance. Regards, evviswanath
RE: how to change name of war & ear file based on user input values
Thank you for prompt reply. If ant -Dxyz=1 -Dyyy=1 ear-targetthen earfile name is webpro.ear If ant -Dxyz=1 -Dyyy=2 ear-target then earfile name should be like this webpro2.ear. For thet do I need to write & ? Please help Thanks & regards, vishy -Original Message- From: Scot P. Floess [mailto:sflo...@nc.rr.com] Sent: Tuesday, July 21, 2009 6:12 PM To: Ant Users List Subject: Re: how to change name of war & ear file based on user input values Well just include the environment variables in your call to the ear task... For example, I am modifying the example given in the Ant documentation for creating an ear: HTH, Flossy On Tue, 21 Jul 2009, edumudi.viswan...@oracle.com wrote: > Hi, > > > > I have an build.xml file. > > > > If I run the target "ear-target" using ant -Dxyz=1 -Dyyy=1 ear-target@ > command prompt, it should create webpro11.ear & webpro11.war > > > > & if I run "ear-target" using ant -Dxyz=1 -Dyyy=2 ear-target@ command > prompt, it should create webpro12.ear & webpro12.ear > > > > How can I achieve this ? > > > > Any idea? > > > > Thanks in adavance. > > > > Regards, > > evviswanath > > Scot P. Floess 27 Lake Royale Louisburg, NC 27549 252-478-8087 (Home) 919-890-8117 (Work) Chief Architect JPlate http://sourceforge.net/projects/jplate Chief Architect JavaPIM http://sourceforge.net/projects/javapim Architect Keros http://sourceforge.net/projects/keros - To unsubscribe, e-mail: user-unsubscr...@ant.apache.org For additional commands, e-mail: user-h...@ant.apache.org - To unsubscribe, e-mail: user-unsubscr...@ant.apache.org For additional commands, e-mail: user-h...@ant.apache.org
problem with macrodef in ant
Hi Friends, I have macrodef in build.xml & it took parameters like wsdlfile & bindingfile from wsdl2java tag ie . Now, If I run macrodef with wsdlfile1 & bindingfile1, It works asusually. But if I run same macrodef again with wsdlfile2 & bindingfile2, In that case it taking previous bindingfile1 instead of new given buildingfile2. Below I provided macrodef & I am calling macrodef with target name=" generate.service" and target name=" generate.service1" respectively. 1) 2) 3) Please help me to solve this issue. Thanks & Regards, vishy - To unsubscribe, e-mail: user-unsubscr...@ant.apache.org For additional commands, e-mail: user-h...@ant.apache.org
RE: problem with macrodef in ant
Below I proded the exception related information. I used the same code which I provided to you. Please check it. generate.service: [echo] Generating code using wsdl2java... [java] Loading FrontEnd jaxws ... [java] Loading DataBinding jaxb ... [java] wsdl2java -b ../root-dir/bindingfile1.xml -exsh true -verbose -d C:\xyz\yzx\root-dir/src C:\xyz\yzx\root-dir/wsdl/wsdlfile1.wsdl [java] wsdl2java - Apache CXF 2.1.5 generate.service1: [echo] Generating code using wsdl2java... [java] Loading FrontEnd jaxws ... [java] Loading DataBinding jaxb ... [java] wsdl2java -b ../root-dir/bindingfile1.xml -exsh true -verbose -d C:\xyz\yzx\root-dir/src C:\xyz\yzx\root-dir/wsdl/wsdlfile2.wsdl [java] wsdl2java - Apache CXF 2.1.5 [java] WSDLToJava Error: Thrown by JAXB : "file:/C:\xyz\yzx\root-dir/wsdl/wsdlfile1.xsd is not a part of this compilation. Is this a mistake for "file:/C:\xyz\yzx\root-dir/wsdl/wsdlfile2.xsd"? [java] org.apache.cxf.tools.common.ToolException: Thrown by JAXB : "file:/C:\xyz\yzx\root-dir/wsdl/wsdlfile1.xsd is not a part of this compilation. Is this a mistake for "file:/C:\xyz\yzx\root-dir/wsdl/wsdlfile2.xsd"? [java] at org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBBindErrorListener.error(JAXBBind ErrorListener.java:34) [java] at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.error(SchemaCompilerImpl.java:2 85) [java] at com.sun.tools.xjc.reader.internalizer.Internalizer.reportError(Internalizer.java: 504) [java] at com.sun.tools.xjc.reader.internalizer.Internalizer.reportError(Internalizer.java: 495) [java] at com.sun.tools.xjc.reader.internalizer.Internalizer.buildTargetNodeMap(Internalize r.java:205) [java] at com.sun.tools.xjc.reader.internalizer.Internalizer.buildTargetNodeMap(Internalize r.java:289) [java] at com.sun.tools.xjc.reader.internalizer.Internalizer.transform(Internalizer.java:13 4) [java] at com.sun.tools.xjc.reader.internalizer.Internalizer.transform(Internalizer.java:96 ) [java] at com.sun.tools.xjc.reader.internalizer.DOMForest.transform(DOMForest.java:448) [java] at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:22 1) [java] at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:85 ) [java] at org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBDataBinding.initialize(JAXBDataB inding.java:218) [java] at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.generateTypes(WSDLToJavaContainer .java:577) [java] at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaContainer.j ava:228) [java] at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java: 130) [java] at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java: 272) [java] at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:83) [java] at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:103) [java] at org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:173) [java] Caused by: com.sun.istack.SAXParseException2: "file:/C:\xyz\yzx\root-dir/wsdl/wsdlfile1.xsd is not a part of this compilation. Is this a mistake for "file:/C:\xyz\yzx\root-dir/wsdl/wsdlfile2.xsd"? [java] at com.sun.tools.xjc.reader.internalizer.Internalizer.reportError(Internalizer.java: -Original Message- From: Scot P. Floess [mailto:sflo...@nc.rr.com] Sent: Tuesday, July 28, 2009 7:39 PM To: Ant Users List Subject: Re: problem with macrodef in ant I tried your example but cutting down on everything in wsdl2java - meaning just used some statements... It worked fine for me: ant generate.service generate.service1 Buildfile: build.xml generate.service: [echo] file[wsdlfile1] [echo] bindingfile [buildingfile1] generate.service1: [echo] file[wsdlfile2] [echo] bindingfile [buildingfile2] Here is the build.xml I used: On Tue, 28 Jul 2009, edumudi.viswan...@oracle.com wrote: > Hi Friends, > > I have macrodef in build.xml & it took parameters like wsdlfile & bindingfile > from wsdl2java tag ie />. > > Now, If I run macrodef with wsdlfile1 & bindingfile1, It works asusually. > > But if I run same macrodef again with wsdlfile2 & bindingfile2, In that case > it taking previous bindingfile1 instead of new given buildingfile2. > > Below I provided macrodef & I am calling macrod
RE: problem with macrodef in ant
Further to below mail, I found that it failing @ the following code in macrodef. > > > > value="${cxf.etc.dir}/logging.properties"/> > > > > > > > > > > -Original Message- From: edumudi.viswan...@oracle.com [mailto:edumudi.viswan...@oracle.com] Sent: Tuesday, July 28, 2009 8:16 PM To: Ant Users List Subject: RE: problem with macrodef in ant Below I proded the exception related information. I used the same code which I provided to you. Please check it. generate.service: [echo] Generating code using wsdl2java... [java] Loading FrontEnd jaxws ... [java] Loading DataBinding jaxb ... [java] wsdl2java -b ../root-dir/bindingfile1.xml -exsh true -verbose -d C:\xyz\yzx\root-dir/src C:\xyz\yzx\root-dir/wsdl/wsdlfile1.wsdl [java] wsdl2java - Apache CXF 2.1.5 generate.service1: [echo] Generating code using wsdl2java... [java] Loading FrontEnd jaxws ... [java] Loading DataBinding jaxb ... [java] wsdl2java -b ../root-dir/bindingfile1.xml -exsh true -verbose -d C:\xyz\yzx\root-dir/src C:\xyz\yzx\root-dir/wsdl/wsdlfile2.wsdl [java] wsdl2java - Apache CXF 2.1.5 [java] WSDLToJava Error: Thrown by JAXB : "file:/C:\xyz\yzx\root-dir/wsdl/wsdlfile1.xsd is not a part of this compilation. Is this a mistake for "file:/C:\xyz\yzx\root-dir/wsdl/wsdlfile2.xsd"? [java] org.apache.cxf.tools.common.ToolException: Thrown by JAXB : "file:/C:\xyz\yzx\root-dir/wsdl/wsdlfile1.xsd is not a part of this compilation. Is this a mistake for "file:/C:\xyz\yzx\root-dir/wsdl/wsdlfile2.xsd"? [java] at org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBBindErrorListener.error(JAXBBind ErrorListener.java:34) [java] at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.error(SchemaCompilerImpl.java:2 85) [java] at com.sun.tools.xjc.reader.internalizer.Internalizer.reportError(Internalizer.java: 504) [java] at com.sun.tools.xjc.reader.internalizer.Internalizer.reportError(Internalizer.java: 495) [java] at com.sun.tools.xjc.reader.internalizer.Internalizer.buildTargetNodeMap(Internalize r.java:205) [java] at com.sun.tools.xjc.reader.internalizer.Internalizer.buildTargetNodeMap(Internalize r.java:289) [java] at com.sun.tools.xjc.reader.internalizer.Internalizer.transform(Internalizer.java:13 4) [java] at com.sun.tools.xjc.reader.internalizer.Internalizer.transform(Internalizer.java:96 ) [java] at com.sun.tools.xjc.reader.internalizer.DOMForest.transform(DOMForest.java:448) [java] at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:22 1) [java] at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:85 ) [java] at org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBDataBinding.initialize(JAXBDataB inding.java:218) [java] at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.generateTypes(WSDLToJavaContainer .java:577) [java] at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaContainer.j ava:228) [java] at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java: 130) [java] at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java: 272) [java] at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:83) [java] at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:103) [java] at org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:173) [java] Caused by: com.sun.istack.SAXParseException2: "file:/C:\xyz\yzx\root-dir/wsdl/wsdlfile1.xsd is not a part of this compilation. Is this a mistake for "file:/C:\xyz\yzx\root-dir/wsdl/wsdlfile2.xsd"? [java] at com.sun.tools.xjc.reader.internalizer.Internalizer.reportError(Internalizer.java: -Original Message- From: Scot P. Floess [mailto:sflo...@nc.rr.com] Sent: Tuesday, July 28, 2009 7:39 PM To: Ant Users List Subject: Re: problem with macrodef in ant I tried your example but cutting down on everything in wsdl2java - meaning just used some statements... It worked fine for me: ant generate.service generate.service1 Buildfile: build.xml generate.service: [echo] file[wsdlfile1] [echo] bindingfile [buildingfile1] generate.service1: [echo] file[wsdlfile2] [echo] bindingfile [buildingfile2] Here is the build.xml I used: On Tue, 28 Jul 2009, edumudi.v
RE: problem with macrodef in ant
Is there any alternative solution for that? Can u say how I need to search for that in google. I tried but no use. Any suggestions? Thanks Vishy -Original Message- From: Scot P. Floess [mailto:sflo...@nc.rr.com] Sent: Tuesday, July 28, 2009 8:38 PM To: Ant Users List Subject: RE: problem with macrodef in ant Double check your setting of bindingarg: For your first run, you set the property bingding.arg to: -b "@{bindingfile}" Of course assuming binding.arg wasn't already set ;) For your second run, you cannot reset binding.arg - regardless... If you need to reset the property you may need to look to Ant Contrib or do something different... Basically, it gets set correctly the first time but not the second... If you put an right after your element - I think you will see the attribute is set correctly in your macrodef... Its just how you are using the property internal to your macrodef... Stock Ant you cannot reset a property once you set it :) On Tue, 28 Jul 2009, edumudi.viswan...@oracle.com wrote: > Further to below mail, I found that it failing @ the following code in > macrodef. > > fork="yes"> >> >> >> >>> value="${cxf.etc.dir}/logging.properties"/> >> >> >> >> >> >> >> >> >> >> > > -Original Message- > From: edumudi.viswan...@oracle.com [mailto:edumudi.viswan...@oracle.com] > Sent: Tuesday, July 28, 2009 8:16 PM > To: Ant Users List > Subject: RE: problem with macrodef in ant > > > Below I proded the exception related information. I used the same code which > I provided to you. Please check it. > > generate.service: > [echo] Generating code using wsdl2java... > [java] Loading FrontEnd jaxws ... > [java] Loading DataBinding jaxb ... > [java] wsdl2java -b ../root-dir/bindingfile1.xml -exsh true -verbose -d > C:\xyz\yzx\root-dir/src C:\xyz\yzx\root-dir/wsdl/wsdlfile1.wsdl > [java] wsdl2java - Apache CXF 2.1.5 > > > generate.service1: > [echo] Generating code using wsdl2java... > [java] Loading FrontEnd jaxws ... > [java] Loading DataBinding jaxb ... > [java] wsdl2java -b ../root-dir/bindingfile1.xml -exsh true -verbose -d > C:\xyz\yzx\root-dir/src C:\xyz\yzx\root-dir/wsdl/wsdlfile2.wsdl > [java] wsdl2java - Apache CXF 2.1.5 > > > [java] WSDLToJava Error: Thrown by JAXB : > "file:/C:\xyz\yzx\root-dir/wsdl/wsdlfile1.xsd is not a part of this > compilation. Is this a mistake for > "file:/C:\xyz\yzx\root-dir/wsdl/wsdlfile2.xsd"? > > [java] org.apache.cxf.tools.common.ToolException: Thrown by JAXB : > "file:/C:\xyz\yzx\root-dir/wsdl/wsdlfile1.xsd is not a part of this > compilation. Is this a mistake for > "file:/C:\xyz\yzx\root-dir/wsdl/wsdlfile2.xsd"? > [java] at > org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBBindErrorListener.error(JAXBBind > ErrorListener.java:34) > [java] at > com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.error(SchemaCompilerImpl.java:2 > 85) > [java] at > com.sun.tools.xjc.reader.internalizer.Internalizer.reportError(Internalizer.java: > 504) > [java] at > com.sun.tools.xjc.reader.internalizer.Internalizer.reportError(Internalizer.java: > 495) > [java] at > com.sun.tools.xjc.reader.internalizer.Internalizer.buildTargetNodeMap(Internalize > r.java:205) > [java] at > com.sun.tools.xjc.reader.internalizer.Internalizer.buildTargetNodeMap(Internalize > r.java:289) > [java] at > com.sun.tools.xjc.reader.internalizer.Internalizer.transform(Internalizer.java:13 > 4) > [java] at > com.sun.tools.xjc.reader.internalizer.Internalizer.transform(Internalizer.java:96 > ) > [java] at > com.sun.tools.xjc.reader.internalizer.DOMForest.transform(DOMForest.java:448) > [java] at > com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:22 > 1) > [java] at > com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:85 > ) > [java] at > org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBDataBinding.initialize(JAXBDataB > inding.java:218) > [java] at > org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.generateTypes(WSDLToJavaContainer > .java:577) > [java] at > org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaContainer.j > ava:228) > [java
RE: problem with macrodef in ant
Hi Scot P. Floess, I changed according to ur suggestion. It worked. Can u alloborate your exploration for the below two code blocks. >>> >>> >>> >>> >>> >>> >>> classname="org.apache.cxf.tools.wsdlto.WSDLToJava" fork="yes"> > > > > value="${cxf.etc.dir}/logging.properties"/> > > > > > > > > > > > > > > Thanks & Regards, vishy -Original Message- From: Scot P. Floess [mailto:sflo...@nc.rr.com] Sent: Wednesday, July 29, 2009 2:37 AM To: Ant Users List Subject: RE: problem with macrodef in ant Oh your welcome - I hope it works :) On Tue, 28 Jul 2009, Edumudi Viswanath wrote: > Hi Scot P. Floess, > > thank you very much for your extended cooperation. > > i will change code according to your suggestion & will u know the result. > > Thanks & Regards, > vishy > > -Original Message- >> From Scot P. Floess > Sent Tue 7/28/2009 7:58 PM > To Ant Users List > Subject RE: problem with macrodef in ant > > > No you miss my point completely... > > I don't think you need to set a property at all :) > > Look below. Specifically where I comment in your call to the task. > I list the comment as "Change these arg lines" > > classname="org.apache.cxf.tools.wsdlto.WSDLToJava" fork="yes"> > > > > value="${cxf.etc.dir}/logging.properties"/> > > > > > > > > > > > > > > > > So from what I can see, you are trying to set a property to store your > command line argument - when its really unnecessary. Just use it inline > as I have done above... > > No need for another macrodef - just modify the task inside the > current macrodef. > > Also, I note you have a similar problem with property entitled exsh.arg. > I took the liberty of changing that above as well.. > > > On Tue, 28 Jul 2009, Edumudi Viswanath wrote: > >> >> as u know, i used only one microdef for 2 different targets. will i try with >> different macrodef for every target? >> >> -Original Message- >>> From Scot P. Floess >> Sent Tue 7/28/2009 4:49 PM >> To Ant Users List >> Subject RE: problem with macrodef in ant >> >> >> Actually, why don't you just use this: >> >> >> >> Or some other kind of variant? Is there some reason you are trying to >> store that in a property? >> >> On Tue, 28 Jul 2009, edumudi.viswan...@oracle.com wrote: >> >>> Is there any alternative solution for that? >>> >>> Can u say how I need to search for that in google. I tried but no use. Any >>> suggestions? >>> >>> Thanks >>> Vishy >>> >>> -Original Message- >>> From: Scot P. Floess [mailto:sflo...@nc.rr.com] >>> Sent: Tuesday, July 28, 2009 8:38 PM >>> To: Ant Users List >>> Subject: RE: problem with macrodef in ant >>> >>> >>> Double check your setting of bindingarg: >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> For your first run, you set the property bingding.arg to: > 5~>>-b "@{bindingfile}" >>> >>> Of course assuming binding.arg wasn't already set ;) >>> >>> For your second run, you cannot reset binding.arg - regardless... If you >>> need to reset the property you may need to look to Ant Contrib or do >>> something different... >>> >>> Basically, it gets set correctly the first time but not the second... >>> >>> If you put an right after >>> your element - I think you will see the attribute is set >>> correctly in your macrodef... Its just how you are using the property >>> internal to your macrodef... >>> >>> Stock Ant you cannot reset a property once you set it :) >>> >>> >>> >>> >>> >>> >>> On Tue, 28 Jul 2009, edumudi.viswan...@oracle.com
Re: problem with macrodef in ant
I got ur point.. thank u very much. Regards, Vishy -Original Message- From: Scot P. Floess [mailto:sflo...@nc.rr.com] Sent: Wednesday, July 29, 2009 5:34 PM To: Ant Users List Subject: RE: problem with macrodef in ant The only real exploration I did was to review your code ;) When I saw the blocks and how you were using them in the task it just seemed you were trying to use properties like variables - that is why I initially mentioned Ant Contrib's task... I took a closer look and saw your intent - then realized you didn't need variables per se. Not sure - but does that answer your question? On Wed, 29 Jul 2009, edumudi.viswan...@oracle.com wrote: > Hi Scot P. Floess, > > I changed according to ur suggestion. It worked. > > Can u alloborate your exploration for the below two code blocks. >>>> >>>> >>>> >>>> >>>> >>>> >>>> > > > > > > classname="org.apache.cxf.tools.wsdlto.WSDLToJava" fork="yes"> >> >> >> >> > value="${cxf.etc.dir}/logging.properties"/> >> >> >> >> >> >> >> >> >> >> >> >> >> >> > > > Thanks & Regards, > vishy > > -Original Message- > From: Scot P. Floess [mailto:sflo...@nc.rr.com] > Sent: Wednesday, July 29, 2009 2:37 AM > To: Ant Users List > Subject: RE: problem with macrodef in ant > > > Oh your welcome - I hope it works :) > > On Tue, 28 Jul 2009, Edumudi Viswanath wrote: > >> Hi Scot P. Floess, >> >> thank you very much for your extended cooperation. >> >> i will change code according to your suggestion & will u know the result. >> >> Thanks & Regards, >> vishy >> >> -Original Message- >>> From Scot P. Floess >> Sent Tue 7/28/2009 7:58 PM >> To Ant Users List >> Subject RE: problem with macrodef in ant >> >> >> No you miss my point completely... >> >> I don't think you need to set a property at all :) >> >> Look below. Specifically where I comment in your call to the task. >> I list the comment as "Change these arg lines" >> >> > classname="org.apache.cxf.tools.wsdlto.WSDLToJava" fork="yes"> >> >> >> >> > value="${cxf.etc.dir}/logging.properties"/> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> So from what I can see, you are trying to set a property to store your >> command line argument - when its really unnecessary. Just use it inline >> as I have done above... >> >> No need for another macrodef - just modify the task inside the >> current macrodef. >> >> Also, I note you have a similar problem with property entitled exsh.arg. >> I took the liberty of changing that above as well.. >> >> >> On Tue, 28 Jul 2009, Edumudi Viswanath wrote: >> >>> >>> as u know, i used only one microdef for 2 different targets. will i try >>> with different macrodef for every target? >>> >>> -Original Message- >>>> From Scot P. Floess >>> Sent Tue 7/28/2009 4:49 PM >>> To Ant Users List >>> Subject RE: problem with macrodef in ant >>> >>> >>> Actually, why don't you just use this: >>> >>> >>> >>> Or some other kind of variant? Is there some reason you are trying to >>> store that in a property? >>> >>> On Tue, 28 Jul 2009, edumudi.viswan...@oracle.com wrote: >>> >>>> Is there any alternative solution for that? >>>> >>>> Can u say how I need to search for that in google. I tried but no use. Any >>>> suggestions? >>>> >>>> Thanks >>>> Vishy >>>> >>>> -Original Message- >>>> From: Scot P. Floess [mailto:sflo...@nc.rr.com] >>>> Sent: Tuesday, July 28, 2009 8:38 PM >>>> To: Ant Users List &g