<?xml version="1.0"?>
<project name="spring-ws-airline-sample-jms-client" default="build"
        xmlns:artifact="urn:maven-artifact-ant">
    <property name="bin.dir" value="bin"/>
    <property name="src.dir" value="src"/>

    <target name="init">
        <typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="urn:maven-artifact-ant">
            <classpath>
                <pathelement location="${basedir}/../../../maven-ant-tasks-2.0.7.jar"/>
            </classpath>
        </typedef>

        <artifact:remoteRepository id="main" url="http://repo1.maven.org/maven2/"/>
        <artifact:remoteRepository id="java.net" url="https://maven-repository.dev.java.net/nonav/repository"
                layout="legacy"/>
        <artifact:remoteRepository id="spring-ext"
            url="https://springframework.svn.sourceforge.net/svnroot/springframework/repos/repo-ext/"/>

        <artifact:dependencies pathId="compile.classpath">
            <remoteRepository refid="main"/>
            <remoteRepository refid="java.net"/>
            <remoteRepository refid="spring-ext"/>
            <dependency groupId="javax.xml.soap" artifactId="saaj-api" version="1.3"/>
            <dependency groupId="org.apache.activemq" artifactId="activemq-core" version="4.1.1"/>
            <dependency groupId="org.springframework.ws" artifactId="spring-ws-core" version="1.5.3"/>
        </artifact:dependencies>

        <artifact:dependencies pathId="runtime.classpath">
            <remoteRepository refid="main"/>
            <remoteRepository refid="java.net"/>
            <remoteRepository refid="spring-ext"/>
            <dependency groupId="com.sun.xml.messaging.saaj" artifactId="saaj-impl" version="1.3"/>
            <dependency groupId="org.springframework.ws" artifactId="spring-ws-support" version="1.5.3"/>
            <dependency groupId="org.springframework" artifactId="spring-jms" version="2.5.1"/>
        </artifact:dependencies>

    </target>


    <target name="build" depends="init">
        <mkdir dir="${bin.dir}"/>
        <javac srcdir="${src.dir}" destdir="${bin.dir}" debug="true">
            <classpath refid="compile.classpath"/>
        </javac>
        <copy todir="${bin.dir}">
            <fileset dir="${src.dir}">
                <exclude name="**/*.java"/>
            </fileset>
        </copy>
    </target>

    <target name="clean">
        <delete dir="${bin.dir}"/>
    </target>

    <target name="run" depends="build">
        <java classname="org.springframework.ws.samples.airline.client.jms.JmsClient" fork="true" failonerror="true">
            <classpath refid="compile.classpath"/>
            <classpath refid="runtime.classpath"/>
            <classpath location="${bin.dir}"/>
        </java>
    </target>

</project>
