ant 编译
<project name="spider3" default="complie" basedir="."><property name="src" value="src" />
<property name="build" value="build" />
<property name="WebRoot" value="WebRoot"/>
<target name="init">
<delete dir="${build}"></delete>
<mkdir dir="${build}/WebRoot/WEB-INF/lib/classes"> </mkdir>
</target >
<target name="complie" depends="init">
<path id="x_classpath">
<fileset dir="${basedir}/WebRoot/WEB-INF/lib/">
<include name="**/*.jar"/>
</fileset>
</path>
<javac srcdir="${basedir}/src/com/ape/spider3/manager/action/" debug="true" includes="**/*.java" nowarn="yes" destdir="${build}/WebRoot/WEB-INF/lib/classes" source="1.6" target="1.6">
<classpath refid="x_classpath"/>
<compilerarg value="-Xlint"/>
</javac>
</target>
<target name="buildwar" depends="init">
<echo message="Start Packet............." />
<war warfile="${build}/spider3.war" webxml="${WebRoot}/WEB-INF/web.xml">
<fileset dir="${WebRoot}"></fileset>
</war>
<echo message="End Packet............." />
</target>
</project>
运行完之后
Buildfile: E:\workspaces\spider3\build.xml
init:
[delete] Deleting directory E:\workspaces\spider3\build
[mkdir] Created dir: E:\workspaces\spider3\build\WebRoot\WEB-INF\lib\classes
complie:
[javac] Compiling 8 source files to E:\workspaces\spider3\build\WebRoot\WEB-INF\lib\classes
可是E:\workspaces\spider3\build\WebRoot\WEB-INF\lib\classes
里什么也没有 这时为什么 --------------------编程问答-------------------- 有懂ant的吗 帮忙看下 --------------------编程问答-------------------- complie:
[javac] Compiling 8 source files to E:\workspaces\spider3\build\WebRoot\WEB-INF\lib\classes
证明已经编译好了,你是不是在Eclipse里看不到文件?在电脑E盘里找找看 --------------------编程问答-------------------- 肯定那没编译好
要是编译好了
uildfile: E:\workspaces\Ant\build.xml
init:
[delete] Deleting directory E:\workspaces\Ant\WebRoot\WEB-INF\classes
[mkdir] Created dir: E:\workspaces\Ant\WebRoot\WEB-INF\classes
complie:
[javac] Compiling 8 source files to E:\workspaces\Ant\WebRoot\WEB-INF\classes
BUILD SUCCESSFUL
Total time: 750 milliseconds
--------------------编程问答-------------------- 那报错了没??!!!! --------------------编程问答-------------------- 没有报错 classes 下什么也没有 --------------------编程问答-------------------- 有高手吗 是不是jar 包没引对
补充:Java , Java EE