I've already read some articles but I'm not able to understand how I should setup an Ivy file for dependencies. The project I'm working on is old and I don't know it much, I have this half generated - half edited build.xml file which works with Eclipse compiler. It's the first time I deal with build configuration, I want to move the dependencies to the ivysettings.xml file and improve what can be improved. My target is to create a war to deploy in Tomcat.
What could be the best way to do it?
build.xml :
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project basedir="." default="build" name="Teamwork"
xmlns:ivy="antlib:org.apache.ivy.ant">
<property environment="env"/>
<property name="ECLIPSE_HOME" value="../../../../../Program Files/eclipse/"/>
<property name="debuglevel" value="source,lines,vars"/>
<property name="target" value="1.7"/>
<property name="source" value="1.7"/>
<path id="Web App Libraries.libraryclasspath">
<pathelement location="WebContent/WEB-INF/lib/Tidy.jar"/>
<pathelement location="WebContent/WEB-INF/lib/antlr-2.7.7.jar"/>
<pathelement location="WebContent/WEB-INF/lib/asm-attrs.jar"/>
<pathelement location="WebContent/WEB-INF/lib/asm.jar"/>
<pathelement location="WebContent/WEB-INF/lib/avro-1.5.1.jar"/>
<pathelement location="WebContent/WEB-INF/lib/aws-java-sdk-1.5.5.jar"/>
<pathelement location="WebContent/WEB-INF/lib/bsh-2.0b4.jar"/>
<pathelement location="WebContent/WEB-INF/lib/c3p0-0.9.2.1.jar"/>
<pathelement location="WebContent/WEB-INF/lib/commons-beanutils.jar"/>
[... other jars]
</path>
<path id="EAR Libraries.libraryclasspath"/>
<path id="Teamwork.classpath">
<pathelement location="bin"/>
<path refid="Web App Libraries.libraryclasspath"/>
<path refid="EAR Libraries.libraryclasspath"/>
</path>
<target name="init">
<mkdir dir="bin"/>
<copy includeemptydirs="false" todir="bin">
<fileset dir="src">
<exclude name="**/*.java"/>
</fileset>
</copy>
</target>
<target name="clean">
<delete dir="bin"/>
</target>
<target depends="clean" name="cleanall"/>
<target depends="build-subprojects,build-project" name="build"/>
<target name="build-subprojects"/>
<target depends="init" name="build-project">
<echo message="${ant.project.name}: ${ant.file}"/>
<javac debug="true" debuglevel="${debuglevel}" destdir="bin" includeantruntime="false" source="${source}" target="${target}">
<src path="src"/>
<classpath refid="Teamwork.classpath"/>
</javac>
</target>
<target description="Build all projects which reference this project. Useful to propagate changes." name="build-refprojects"/>
<target description="copy Eclipse compiler jars to ant lib directory" name="init-eclipse-compiler">
<copy todir="${ant.library.dir}">
<fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
</copy>
<unzip dest="${ant.library.dir}">
<patternset includes="jdtCompilerAdapter.jar"/>
<fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
</unzip>
</target>
<target description="compile project with Eclipse compiler" name="build-eclipse-compiler">
<property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
<antcall target="build"/>
</target>
</project>