Error in my build.xml file (help with spotting syntax error requested)

Hi

I have written an XML file called build.xml for one of my applications. My XML editor complains that there is an error at the last line of the XML file, but I simply find it unable to correct the errror.

It says:

Fatal error:Build.xml[76:3-9]: End-Tag without start-tag

The XML file itself:

--

<project basedir="." default="deploy" name="concepts">

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

<property name="build.dir" value="${basedir}/build"></property>

<property name="build.lib" value="${build.dir}/lib"></property>

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

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

<property name="build.etc" value="${src.dir}/etc"></property>

<property name="build.resources" value="${src.dir}/resources"></property>

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

<property name="web-inf.dir" value="WEB-INF"></property>

<property name="war.name" value="concepts"></property>

<property file="../common.properties"></property>

<target name="init">

<mkdir dir="${build.dir}"></mkdir>

<mkdir dir="${classes.dir}"></mkdir>

<mkdir dir="${dist.dir}"></mkdir>

</target>

<target name="deploy" depends="clover-yes, clover-no">

<javac srcdir="${src.dir}" destdir="${classes.dir}" classpath="${libs}" debug="off" optimize="on" deprecation="on" compiler="${compiler}">

<include name="org/apache/commons/fileupload/**/*.java" />

<include name="com/portalbook/portlets/**/*.java" />

<include name="com/portalbook/portlets/content/**/*.java" />

</javac>

<target depends="init" name="compile">

<javac debug="true" deprecation="true" destdir="${classes.dir}" optimize="false">

<src>

<pathelement location="${src.dir}"></pathelement>

</src>

<classpath>

<fileset dir="${lib.dir}">

<include name="*.jar">

</include>

</fileset>

</classpath>

</javac>

</target>

<target depends="compile" name="war">

<war destfile="${dist.dir}/${war.name}.war" webxml="WEB-INF/web.xml">

<classes dir="${classes.dir}"></classes>

<lib dir="${lib.dir}"></lib>

<webinf dir="${web-inf.dir}"></webinf>

</war>

</target>

<!-- create the portal-concepts-lib.jar -->

<jar jarfile="${build.lib}/concepts-lib.jar">

<fileset dir="${classes.dir}"></fileset>

</jar>

<jar jarfile="${build.lib}/concepts.war" manifest="${build.etc}/concepts-war.mf">

<fileset dir="${build.resources}/concepts-war"></fileset>

</jar>

<!-- concepts.ear -->

<copy todir="${build.resources}/concepts-ear">

<fileset dir="${build.lib}" includes="concepts.war,concepts-lib.jar"></fileset>

</copy>

<jar jarfile="${build.lib}/concepts.ear">

<fileset dir="${build.resources}/concepts-ear" includes="concepts.war,concepts-lib.jar">

</fileset>

</jar>

<target depends="deploy" name="explode">

<taskdef classname="org.jboss.nukes.common.ant.Explode" classpath="${libs}" name="explode"></taskdef>

<explode file="${build.lib}/concepts.ear" name="concepts.ear" todir="${build.lib}/exploded"></explode>

</target>

<target depends="war" name="all"></target>

<target name="clean">

<delete dir="${build.dir}">

</delete>

<delete dir="${dist.dir}">

</delete>

</target>

</project>

-

I am a little inexperienced in XML files. So I am unable to spot the error.

I would greatly appreciate it, if some kind soul were to help me out.

thanks a lot

[4264 byte] By [ilango171a] at [2007-10-2 15:42:32]
# 1

The tag

<target name="deploy" depends="clover-yes, clover-no">...

is never closed.

close that tag:

<target name="deploy" depends="clover-yes, clover-no">

<javac srcdir="${src.dir}" destdir="${classes.dir}" classpath="${libs}" debug="off" optimize="on" deprecation="on" compiler="${compiler}">

<include name="org/apache/commons/fileupload/**/*.java" />

<include name="com/portalbook/portlets/**/*.java" />

<include name="com/portalbook/portlets/content/**/*.java" />

</javac>

</target>

Second error is that the depends in there (clover-yes, clover-no) are not existing as targets in your xml.

mezlera at 2007-7-13 15:30:41 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2
HiThanks a lot.Let me clarify again: In the following statement:<target name="deploy" depends="clover-yes, clover-no">So should I omit the the '>' in the statement abovethanks
ilango171a at 2007-7-13 15:30:41 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 3
HiSo could you post the modified form of the xml file with the changes you suggested. I will be very grateful to you. The reason I ask is because I am not clear how to make 'clover" as the target. Thanks a lot in advance
ilango171a at 2007-7-13 15:30:41 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 4

Hi

Do you think that the following is a right way to use Clover as a target:

<project default="clover" name="CloverAnt">

<taskdef resource="net/sf/antcontrib/antcontrib.properties"/>

<taskdef resource="clovertasks"/>

<typedef resource="clovertypes"/>

<target name="setup">

<mkdir dir="clover-db"/>

<clover-setup initstring="clover-db/ant_coverage.db">

</clover-setup>

</target>

<target name="clover" depends="setup">

<ant antfile="build.xml" target="clean" inheritall="false"/>

<ant antfile="build.xml" target="build" inheritrefs="true"/........

.........................................

thanks again>

ilango171a at 2007-7-13 15:30:41 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 5
looks OK to me
mezlera at 2007-7-13 15:30:41 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 6
Hithanks againCould you clarify again as to what I should do on the "clover-yes, clover-no"?Thanks a lot
ilango171a at 2007-7-13 15:30:41 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 7
You may delete the dependencies or define some targets with name clover-yes/clover-no doing what you want to do when they are called.
mezlera at 2007-7-13 15:30:41 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...