我有以下目录结构
+project
+--profile
+---src
+---WebContent
+---build
我正在尝试使用 Ant 进行编译和复制,但是当我执行以下build.xml文件时,我收到此错误XML 文档结构必须在同一实体内开始和结束,仅此而已。我检查了几个几乎相似的问题,但没有一个有帮助,唯一与此类似的问题是通过在其中添加任何对我不起作用的评论来收集的。我在构建文件中缺少什么?
<?xml version="1.0"?>
<project name="profile" basedir="." default="Task-of-build">
<property name="src.dir" value="src"/>
<property name="webcontent.dir" value="WebContent"/>
<property name="javadoc" value="doc"/>
<property name="name" value="profile"/>
<property name="build.dir" value="${webcontent.dir}/WEB-INF/classes"/>
<property name="backup.dir" value="C:/project/backup"/>
<path id="classpathvalue">
<fileset dir="${webcontent.dir}/WEB-INF/lib">
<include name="*.jar"/>
<!-- this is a comment -->
</fileset>
<pathelement path="${build.dir}"/>
</path>
<target name="javadoc">
<javadoc packagenames="com.mucyo.prep.profile.*" sourcepath="${src.dir}"
destdir = "doc" version="true" windowtitle="Profile Mngt">
<doctitle><![CDATA[<h1>=Profile Mgnt =</h1>]]</doctitle>
<bottom><![CDATA[Copyright 2011. All Rights reserved></bottom>
<group title="Beans packages" packages="com.mucyo.prep.profile.bean.*"/>
<group title="Service packages" pachages="com.mucyo.prep.profile.services.*"/>
<group title="servlets packages" packages="com.mucyo.profile.servlets.*"/>
</javadoc>
</target>
<target name="Task-of-build">
<echo message="This a build example"/>
</target>
<target name="build" description="compiling java files">
<mkdir dir="${build.dir}"/>
<javac destdir="${build.dir}" source="1.6" target="1.6" debug="true"
deprecation="false" optimize="false" failonerror="true">
<src path="${src.dir}"/>
<classpath refid="classpathvalue"/>
</javac>
</target>
<target name="create-war" depends="build">
<war destfile="${name}.war" webxml="${webcontent.dir}/WEB-INF/web.xml">
<fileset dir=".">
<include name="**/*.*"/>
</fileset>
</war>
</target>
<target name="backup" depends="build">
<mkdir dir="${backup.dir}"/>
<copy todir="${backup.dir}" preservelastmodified="true">
<fileset dir=".">
<include dir="${src.dir}:${build.dir}"/>
</fileset>
</copy>
</target>
<target name="clean" depends="build">
<delete>
<fileset dir="${build.dir}">
<include name="**/*.class"/>
</fileset>
</delete>
</target>
</project>