User Manual

Creating the build.xml File
Create the build.xml file to build Axis2/Java archive file of EmpInfo application.
To create the build.xml file, complete the following steps:
1. Create the build.xml file in the EmpInfo directory, as explained in the Creating the
EmpInfo-servlet.xml File section in Getting Started with Spring section.
2. Modify the build.xml file to add the mapping details.
After modification, the build.xml file should appear as:
<project name="EmpInfo" basedir="." default="generate.service">
<property environment="env"/>
<property name="service-name" value="EmpInfoService" />
<property name="dest.dir" value="target" />
<property name="axis2.home" value="<Axis2 Home>" />
<property name="spring.home" value="<Spring Home>" />
<property name="dest.dir.classes" value="${dest.dir}/classes" />
<path id="build.class.path">
<fileset dir="${axis2.home}/lib">
<include name="*.jar" />
</fileset>
<fileset dir="${dest.dir.classes}/lib">
<include name="*.jar" />
</fileset>
<fileset dir="${spring.home}/dist">
<include name="*.jar" />
</fileset>
</path>
<path id="master-classpath">
<fileset dir="${dest.dir.classes}/lib">
<include name="*.jar" />
</fileset>
</path>
<target name="clean">
<delete dir="${dest.dir}" />
</target>
<target name="prepare" depends="clean">
<mkdir dir="${dest.dir}" />
<mkdir dir="${dest.dir.classes}" />
<mkdir dir="${dest.dir.classes}/META-INF" />
<mkdir dir="${dest.dir.classes}/lib"/>
<antcall target="copy.jars"/>
</target>
<target name="generate.service" depends="prepare">
<copy file="WebContent/META-INF/services.xml" tofile="${dest.dir.classes}/META-INF/services.xml"
overwrite="true" />
<copy file="WebContent/WEB-INF/applicationContext.xml" tofile="${dest.dir.classes}/applicationContext.xml"
overwrite="true" />
<copy file="WebContent/WEB-INF/jdbc.properties" tofile="${dest.dir.classes}/jdbc.properties"
overwrite="true" />
<javac debug="on" srcdir="src" destdir="${dest.dir.classes}"
includes="com/hp/empinfo/domain/**,com/hp/empinfo/service/**">
<classpath refid="build.class.path" />
</javac>
<jar basedir="${dest.dir.classes}" destfile="${dest.dir}/${service-name}.aar" />
</target>
<target name="copy.jars">
<copy todir="${dest.dir.classes}/lib">
<fileset dir="${spring.home}/dist/modules">
<include name="*.jar"/>
</fileset>
</copy>
</target>
</project>
3. Edit the build.xml file to specify the values of <Axis2 Home> and <Spring Home> as
shown:
<property name="axis2.home" value="<Axis2 Home>" />
<property name="spring.home" value="<Spring Home>" />
264 Integrating Frameworks