I expected ant to figure out when not to recompile the files which are up to date – unfortunately it keeps happening. My build target contains only:
<javac srcdir="configuration" destdir="${build_env}">
<compilerarg value="-Xlint"/>
</javac>
In verbose ant output I get:
conf:
[javac] MissingConfigurationException.java added as MissingConfigurationException.class doesn't exist.
[javac] TestConfiguration.java added as TestConfiguration.class doesn't exist.
[javac] TestConfigurationStorage.java added as TestConfigurationStorage.class doesn't exist.
[javac] Compiling 3 source files to /blah/build
but they do exist and are available in the “/blah/build/com/blah/configuration/…” directory.
How can I fix this?
I have seen this in the past when the class is defined in a location that differs from the package that was declared in the .java file.
For instance, if we’re looking at a file in com/stackoverflow/ant/error called AJavaFile.java. It better have the package defined as:
or it the javac compiler will put it in a different place than is expected by the package declaration.