Ant Tasks has been created by Benson Margulies (Apr 07, 2008).

Content:

CXF provides ant tasks for wsdl2java and java2ws.

The tasks are delivered in a separate jar file: modules/integration/cxf-anttasks-2.1-incubator-SNAPSHOT.jar. (Remove -SNAPSHOT when using an official release).

Here is a snippet from the wsdl_first_anttask sample provided in the CXF distribution. It shows the declaration of the task jar file via the ant 'antlib' mechanisms, and the use of the wsdl2java task.

<project name="hello world demo" default="build" basedir="."
         xmlns:cxf="antlib:org.apache.cxf.ant.extensions" >

    <import file="../common_build.xml"/>        

    <path id='cxf.anttasks.classpath'>
     <pathelement location='${cxf.home}/modules/integration/cxf-anttasks-2.1-incubator-SNAPSHOT.jar'/>
     <path refid='cxf.classpath'/>
    </path>

    <taskdef uri="antlib:org.apache.cxf.ant.extensions"
             resource="org/apache/cxf/ant/extensions/antlib.xml"
             classpathref="cxf.anttasks.classpath"/>

    <target name="generate.code">
        <echo level="info" message="Generating code using wsdl2java..."/>
        <mkdir dir="${build.src.dir}"/>
        <mkdir dir="${build.classes.dir}"/>
        <cxf:wsdl2java wsdl="${wsdl.dir}/hello_world.wsdl" 
                       sourceDestDir="${build.src.dir}"
                       destDir="${build.classes.dir}"/>
    </target>


</project>

Reply via email to