1
下面是我的ant的build.xml文件。Ant在錯誤的目的地創建jar文件
<?xml version="1.0" encoding="UTF-8"?>
<project name="Struts2ProductsDemo" default="jar">
<property name="src.dir" location="src" />
<property name="build.dir" location="L:\build" />
<property name="project.name" value="Struts2ProductsDemo" />
<target name="clean">
<delete dir="${build.dir}" />
</target>
<target name="makedir">
<mkdir dir="${build.dir}" />
<mkdir dir="${build.dir}/classes" />
</target>
<target name="compile" depends="clean,makedir">
<javac srcdir="${src.dir}" destdir="${build.dir}/classes" />
</target>
<target name="jar" depends="compile">
<jar destfile="${build.jar}/jars/${project.name}.jar" basedir="${build.dir}/classes" />
</target>
文件中創建的罐子:C:\Users\San\EclipseWS\Struts2ProductsDemo\${build.jar}\jars\Struts2ProductsDemo.jar
我期待罐子在這裏:${build.jar}/jars/${project.name}.jar