ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Matèrne (JIRA) <j...@apache.org>
Subject [jira] Commented: (IVY-775) Provide webservice as dependency
Date Mon, 17 Mar 2008 15:11:24 GMT

    [ https://issues.apache.org/jira/browse/IVY-775?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12579476#action_12579476
] 

Jan Matèrne commented on IVY-775:
---------------------------------

I wrote an Ant buildfile which does that already.
- extract the name from the URL as filename without path or suffix/query
- include Axis Ant Tasks
- load the wsdl (<get>)
- create the java files (<axis-wsdl2java>)
- compile and build jar


{code:xml}
<?xml version="1.0" encoding="ISO-8859-1"?>
<project>
" unless="wsdl"/>

    <script language="javascript"> <![CDATA[
        uri = new java.net.URI(project.getProperty("wsdl"));
        name = uri.getPath();
        while (name.indexOf("/") > -1) {
            name = name.substring(name.indexOf("/")+1);
        }
        project.setNewProperty("jar", name + ".jar");
        project.setNewProperty("name", name);
    ]]></script>

    <property name="build.dir" value="build"/>
    <property name="classes.dir" value="${build.dir}/classes"/>
    <property name="build.gen" value="${build.dir}/java"/>

    <path id="axis">
        <fileset dir="lib" includes="*.jar"/>
    </path>
    
    <taskdef resource="axis-tasks.properties" classpathref="axis"/>

    <delete dir="${build.dir}"/>
    <mkdir dir="${build.gen}"/>
    <get src="${wsdl}" dest="${build.dir}/${name}.wsdl"/>

    <axis-wsdl2java
      output="${build.gen}"
      url="${build.dir}/${name}.wsdl">
    </axis-wsdl2java>
    
    <mkdir dir="${classes.dir}"/>
    <javac srcdir="${build.gen}" destdir="${classes.dir}" classpathref="axis"/>
    
    <tstamp/>
    <jar destfile="${build.dir}/${name}.jar" basedir="${classes.dir}">
        <manifest>
            <attribute name="Built-By" value="${user.name}"/>
            <attribute name="Built-Date" value="${DSTAMP} ${TSTAMP}"/>
            <attribute name="WSDL-URL" value="${wsdl}"/>
        </manifest>
    </jar>
</project>
{code}

> Provide webservice as dependency
> --------------------------------
>
>                 Key: IVY-775
>                 URL: https://issues.apache.org/jira/browse/IVY-775
>             Project: Ivy
>          Issue Type: New Feature
>          Components: Core
>            Reporter: Jan Matèrne
>            Priority: Minor
>
> Just an idea: 
> Could it be use to define an URL to a WSDL as dependency and Ivy would download 
> - download the document
> - create the java code (e.g. using Axis)
> - compile the code (using Ant's <compile>)
> - create the jar (using Ant's <jar>)
> - provide that JAR as library
> - provide webservice jars (Axis) as transitive dependency
> I havent any idea about versioning of the wsdl ...
> As said - only an idea.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message