[英]Ant - javac task - classpath is not taking the jars
I have my ant build.xml
file like this: 我有这样的ant build.xml
文件:
<!-- Properties -->
<property name="src" value="${basedir}" />
<property name="jars" value="${src}/jars" />
<property name="dest" value="${src}/dest" />
<property name="reports" value="${src}/reports" />
<path id="claspath">
<fileset dir="${jars}">
<include name="*.jar" />
</fileset>
</path>
<target name="clean">
<echo> removing the directories "dest" and "reports" </echo>
<delete dir="${dest}" />
<delete dir="${reports}" />
</target>
<target name="makedir" depends="clean">
<echo> creating directories "dest" and "reports" </echo>
<mkdir dir="dest" />
<mkdir dir="reports" />
</target>
<target name="complie" depends="makedir">
<javac srcdir="${src}" destdir="${dest}" />
<classpath refid="classpath"/>
</target>
When I type ant
command in cmd prompt the compiling happens but the jar files are not loading so I am getting compiling errors. 当我在cmd中键入ant
命令时,提示编译发生,但jar文件未加载,因此出现编译错误。 The jar folder that i have mentioned in the above code has only one jar file which is "testng-6.8.5.jar". 我在上面的代码中提到的jar文件夹只有一个jar文件,即“ testng-6.8.5.jar”。 Please let me know what is wrong in the above code. 请让我知道以上代码有什么问题。
You're closing the <javac>
tag on the same line, it should be: 您正在同一行上关闭<javac>
标记,它应该是:
<javac srcdir="${src}" destdir="${dest}">
<classpath refid="classpath"/>
</javac>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.