The source and destination directory will be recursively scanned for Java source files to compile. Only Java files that have no corresponding .class file or where the class file is older than the .java file will be compiled.
The above is from javac Task, ANT Apache. But I really don't see why in my case .java is recompiled again and again.
My working directory is .../trunk
My source (.java) is located at trunk/src
My target (.class) is located at trunk/bin
My .java files use default package, namely, no package declaration.
The javac task is used this way in my build.xml
<javac srcdir="${src}"
destdir="${bin}"
includeantruntime="false">
<classpath>
<pathelement location="${bin}"/>
<pathelement path="${java.class.path}"/>
</classpath>
</javac>
where I have defined
<property name="src" value="src"/>
<property name="bin" value="bin/"/>
It seems everything is ok, but each time I run ANT, it recompiles the .java files. Really strange! Anyone would like to tell me why? Thanks.