alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Axis 2 example source code file (build.xml)

This example Axis 2 source code file (build.xml) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Axis 2 tags/keywords

apache, asf, asf, axis2, axis2_home, axis2_home, conditions, license, license, or, see, web-inf/services, web-inf/services, you

The Axis 2 build.xml source code

<?xml version="1.0"?>
<!--
  ~ Licensed to the Apache Software Foundation (ASF) under one
  ~ or more contributor license agreements. See the NOTICE file
  ~ distributed with this work for additional information
  ~ regarding copyright ownership. The ASF licenses this file
  ~ to you under the Apache License, Version 2.0 (the
  ~ "License"); you may not use this file except in compliance
  ~ with the License. You may obtain a copy of the License at
  ~
  ~ http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing,
  ~ software distributed under the License is distributed on an
  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  ~ KIND, either express or implied. See the License for the
  ~ specific language governing permissions and limitations
  ~ under the License.
  -->

<!-- ======================================================================
     Feb 11, 2005 1:04:21 PM                                                        

      This build file is intended to compile and run the Axis2 samples
      provided here with the service being deployed at Tomcat or by
      running a simple Axis2 server.   
     
                   
                                                                     
     ====================================================================== -->
<project name="samples" basedir="." default="compile">
    <property name="src.dir" value="src"/>
    <property name="build.dir" value="build"/>
    <property name="lib.dir" value="${build.dir}/lib"/>
    <property name="classes.dir" value="./classes"/>

    <property name="jardrop.dir" value="${build.dir}/services"/>
    <property environment="env"/>
    <property name="AXIS2_HOME" value="../.."/>
    <property name="axis.serverJarDrop.dir" value="${AXIS2_HOME}/WEB-INF/services"/>

    <property name="conf.dir" value="conf"/>

    <path id="classpath.library">
        <fileset dir="${AXIS2_HOME}/WEB-INF/lib">
            <include name="**/*.jar"/>
        </fileset>
    </path>

    <path id="classpath.client">
        <fileset dir="${lib.dir}">
            <include name="**/*.jar"/>
        </fileset>
    </path>

    <path id="classpath.runtimelibraries">
        <path refid="classpath.library"/>
        <path refid="classpath.client"/>
    </path>


    <target name="clean" description="Delete all generated files">
        <delete dir="${classes.dir}" failonerror="false"/>

        <delete dir="${build.dir}" failonerror="false"/>
    </target>

    <target name="validateAxisHome">
        <available file="${AXIS2_HOME}}" type="dir" property="axis2.deployed"/>
    </target>

    <target name="validateSevices.dir">
        <available file="${AXIS2_HOME}/WEB-INF/services" type="dir" property="axis2.services"/>
    </target>

    <target name="validateDeploymentSettings" depends="validateAxisHome" unless="validateSevices.dir">
        <mkdir dir="${AXIS2_HOME}/WEB-INF/services"/>
    </target>


    <target name="createDir">
        <mkdir dir="${build.dir}"/>
        <mkdir dir="${lib.dir}"/>
        <mkdir dir="${classes.dir}"/>
        <mkdir dir="${jardrop.dir}"/>
    </target>

    <target name="compile" depends="clean,createDir">
        <javac srcdir="${src.dir}" destdir="${classes.dir}">
            <classpath refid="classpath.library"/>
        </javac>
        <jar destfile="${lib.dir}/${ant.project.name}-all.jar">
            <fileset dir="${classes.dir}"/>
        </jar>

        <copy file="${conf.dir}/services.xml" todir="${build.dir}/META-INF" overwrite="true"/>

        <jar destfile="${jardrop.dir}/sample1.jar">

            <fileset dir="${classes.dir}">
                <include name="**/EchoXML.class"/>
            </fileset>
            <fileset dir="${build.dir}">
                <include name="META-INF/services.xml"/>
            </fileset>
        </jar>


        <copy file="${conf.dir}/service4withhandler.xml" tofile="${build.dir}/META-INF/services.xml" overwrite="true"/>

        <jar destfile="${jardrop.dir}/sample1WithHandler.jar">

            <fileset dir="${classes.dir}">
                <include name="**/EchoXML.class"/>
                <include name="**/LoggingHandler.class"/>
            </fileset>
            <fileset dir="${build.dir}">
                <include name="META-INF/services.xml"/>
            </fileset>
        </jar>
        <delete dir="${classes.dir}" failonerror="false"/>
    </target>


    <target name="deploy" depends="compile,validateDeploymentSettings">
        <copy file="${jardrop.dir}/sample1.jar" todir="${axis.serverJarDrop.dir}" overwrite="true"/>
        <copy file="${jardrop.dir}/sample1WithHandler.jar" todir="${axis.serverJarDrop.dir}" overwrite="true"/>
    </target>

    <target name="echo" depends="compile">
        <java classname="userguide.sample1.SynchronousClient">
            <classpath refid="classpath.runtimelibraries"/>
            <arg value="8080"/>
            <arg value="/axis2/services/sample1"/>
        </java>
    </target>

    <target name="echoWithHandler" depends="compile">
        <java classname="userguide.sample1.SynchronousClient">
            <classpath refid="classpath.runtimelibraries"/>
            <arg value="8080"/>
            <arg value="/axis2/services/sample1WithHandler"/>
        </java>
    </target>

    <target name="echoAsync" depends="compile">
        <java classname="userguide.sample1.AsynchronousClient">
            <classpath refid="classpath.runtimelibraries"/>
            <arg value="8080"/>
            <arg value="/axis2/services/sample1"/>
        </java>
    </target>
</project>

Other Axis 2 examples (source code examples)

Here is a short list of links related to this Axis 2 build.xml source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.