In case of compilation errors, the ant javac
task will not compile all classes that can be compiled. It seems that the javac
task (or the compiler itself) just stops as soon as the first error occurs.
The failonerror
property failonerror
not affect this behavior. I do not set the compile
attribute (hence, the Oracle JDK compiler is used).
Is it possible to compile as many classes as possible in case of compilation errors?
(it is advisable not to rely on any particular compiler)
One use case is during development:
Imagine that you are implementing some new features, but you are not done yet, and the compilation of errors remains. At the same time, you need to fix some other error, and so that nothing is broken, you want to run standard test packages that are called by the ant task in the project workspace of your development environment. The ant task tries to compile all the classes / test classes, but the failure is due to compiling errors in the class you are just developing.
It would be very useful to tell ant / javac not to compile compilation errors in order to be able to run as many test cases as possible.
source share