ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  Top 15 Ant Best Practices
Subject:   JAR files under version control and clean build test
Date:   2003-12-20 04:05:34
From:   anonymous2
I agree with all of our practices, we are using ant exactly this may!


however the idea of "dependent JAR files should be managed under version control" (10) may lead to:
<target name="compile" depends="init,externaljars">
<javac srcdir="${src}" destdir="${builddir}">
<classpath>
<pathelement location="${builddir}/>
<pathelement location="${externallibs}/servlet.jar"/>
..
</classpath>
</javac>
</target>
<target name="externaljars">
<cvs package="${externallibs}/servlet.jar"/>
...
</target>


ant will recompile everything, everytime, because whenever the external "servlet.jar" is checked out from version control, the compile targets dependencies have changed. This is in contrast to (14) "Clean Build Test".