java - Using ant and build.xml error -
when try run program on gl server, error. also, have 2 packages, 1 is, , other driver package has driver.java in it. runs program.
build failed target "run" not exist in project "autofill".
why this? here build.xml
<?xml version="1.0" encoding="utf-8" standalone="no"?> <!-- warning: eclipse auto-generated file. modifications overwritten. include user specific buildfile here, create 1 in same directory processing instruction <?eclipse.ant.import?> first entry , export buildfile again. --> <project basedir="." default="build" name="autofill"> <property environment="env"/> <property name="debuglevel" value="source,lines,vars"/> <property name="target" value="1.7"/> <property name="source" value="1.7"/> <path id="autofill.classpath"> <pathelement location="bin"/> </path> <target name="init"> <mkdir dir="bin"/> <copy includeemptydirs="false" todir="bin"> <fileset dir="src"> <exclude name="**/*.launch"/> <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="autofill.classpath"/> </javac> </target> <target description="build projects reference project. useful includeantruntime="false" source="${source}" target="${target}"> <target description="copy eclipse compiler jars ant lib directory" name="init- <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 eclipse compiler" name="build-eclipse compiler"> <property name="build.compiler" value="org.eclipse.jdt.core.jdtcompileradapter"/> <antcall target="build"/> </target> <target name="maxheap"> <java classname="proj3.maxheap" failonerror="true" fork="yes"> <classpath refid="autofill.classpath"/> </java> </target> <target name="driver"> <java classname="driver.driver" failonerror="true" fork="yes"> <classpath refid="autofill.classpath"/> </java> </target> </project>
i've reformatted build.xml
here. there issues it:
<?xml version="1.0" encoding="utf-8" standalone="no"?> <project basedir="." default="build" name="autofill"> <property environment="env"/> <property name="debuglevel" value="source,lines,vars"/> <property name="target" value="1.7"/> <property name="source" value="1.7"/> <path id="autofill.classpath"> <pathelement location="bin"/> </path> <target name="init"> <mkdir dir="bin"/> <copy includeemptydirs="false" todir="bin"> <fileset dir="src"> <exclude name="**/*.launch"/> <exclude name="**/*.java"/> </fileset> </copy> </target> <target name="clean"> <delete dir="bin"/> </target> <target name="cleanall" depends="clean"/> <target name="build" depends="build-subprojects, build-project"/> <target name="build-subprojects"/> <target name="build-project" depends="init"> <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="autofill.classpath"/> </javac> </target> <!-- happened here... --> <target description="build projects reference project. useful "/> <!-- includeantruntime="false" source="${source}" target="${target}"> --> <!-- happened name of target --> <target name="init-" description="copy eclipse compiler jars ant lib directory"> <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> <!-- happened target name --> <target name="build-eclipse compiler" description="compile project eclipse compiler"> <property name="build.compiler" value="org.eclipse.jdt.core.jdtcompileradapter"/> <antcall target="build"/> </target> <target name="maxheap"> <java classname="proj3.maxheap" failonerror="true" fork="yes"> <classpath refid="autofill.classpath"/> </java> </target> <target name="driver"> <java classname="driver.driver" failonerror="true" fork="yes"> <classpath refid="autofill.classpath"/> </java> </target> </project>
i don't know if miscopied it, it's not valid ant build file stands now. may want check post , see if missed anything.
your error pretty straight forward. don't have target named run
. have no idea why executing it. (maybe it's in section of build.xml
messed up.
the valid targets are:
- init
- clean
- cleanall
- build
- build-project
- build-subprojects
- init-??? (target name not complete)
- build-eclipse compiler (invalid target name. can't contain space)
- maxheap (java executable)
- driver (java executable)
if you're attempting compile project, want run build-project
or build
target , not run
. (both build-project
, build
same thing).
if you're attempting run program, maxheap
, driver
2 java executable targets in build.xml
.
so, want execute targets build
, driver
or maxheap
.
Comments
Post a Comment