[Ant] How to factorize tasks? (Newbie-question)
From: contrex (QTRAURFUICIN_at_spammotel.com)
Date: 02/17/04
- Next message: YourKit Team: "YourKit Java Profiler 2.0.1 Released + Personal License Available Now"
- Previous message: michelle: "eclipse java editor with import help"
- Next in thread: Ville Oikarinen: "Re: [Ant] How to factorize tasks? (Newbie-question)"
- Reply: Ville Oikarinen: "Re: [Ant] How to factorize tasks? (Newbie-question)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 17 Feb 2004 08:47:40 -0800
I want to factorize two ant targets (deploy/undeploy). The only
difference is that they call a java class with a different parameter
(a wsdd file). Here is a snippet of the working ant build.xml file:
<project name="MyProject" default="compile" basedir=".">
...
<path id="project.adminclient.classpath">
...
</path>
<target name="deploy">
<java classname="org.apache.axis.client.AdminClient">
<arg value="A"/>
<arg value="B"/>
<arg value="deploy.wsdd"/>
<classpath refid="project.adminclient.classpath" />
</java>
</target>
<target name="undeploy">
<java classname="org.apache.axis.client.AdminClient">
<arg value="A"/>
<arg value="B"/>
<arg value="undeploy.wsdd"/>
<classpath refid="project.adminclient.classpath" />
</java>
</target>
</project>
I thought I could facorize the <java> tag to something like:
<project name="MyProject" default="compile" basedir=".">
...
<path id="project.adminclient.classpath">
...
</path>
<java id="project.adminclient.execute"
classname="org.apache.axis.client.AdminClient">
<arg value="A"/>
<arg value="B"/>
<classpath refid="project.adminclient.classpath" />
</java>
<target name="deploy">
<java refid="project.adminclient.execute">
<arg value="deploy.wsdd"/>
</java>
</target>
<target name="undeploy">
<java refid="project.adminclient.execute">
<arg value="undeploy.wsdd"/>
</java>
</target>
</project>
The call of the <java> tag works but the problem is that the parameter
(wsdd-file) isn't passed to the <java> tag.
Can you say me how one would do this?
Thank you very much!
- Next message: YourKit Team: "YourKit Java Profiler 2.0.1 Released + Personal License Available Now"
- Previous message: michelle: "eclipse java editor with import help"
- Next in thread: Ville Oikarinen: "Re: [Ant] How to factorize tasks? (Newbie-question)"
- Reply: Ville Oikarinen: "Re: [Ant] How to factorize tasks? (Newbie-question)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|