創建2個不同的路徑項目:
<path id="path.tomcat55">
<fileset ... (tomcat5.5 files) />
</path>
<path id="path.tomcat6">
<fileset ... (tomcat6 files) />
</path>
然後建立了55,使用tomcat55路徑創建單獨的目標,另一個是使用的tomcat6建設6。
<target name="compile.tomcat55" depends="build">
<echo message="Compiling for Tomcat 5.5" />
<javac srcdir="${project.basedir}/src/test" destdir="${build.dir}" fork="true" source="1.5" classpathref="path.tomcat55" />
</target>
<target name="compile.tomcat6" depends="build">
<echo message="Compiling for Tomcat 6" />
<javac srcdir="${project.basedir}/src/test" destdir="${build.dir}" fork="true" source="1.5" classpathref="path.tomcat6" />
</target>
然後,只需調用適當的目標。
謝謝,這可能是我必須這樣做的方式。我希望最終只有一個編譯目標,但至少這應該起作用。 – fizban 2010-08-27 10:55:22