Reputation: 792
While compiling using Ant, my Java application gives more than 1000 warnings (mainly deprecated API related as this is a legacy code) and it is very difficult to find error message(s) mixed up with thousands of warnings messaged in the log.
I tried suppressing the warnings by passing arguments in Ant javac task, but didn't work.
Is there any options to separate warnings and errors in the log, like all warnings first and then errors?
Upvotes: 0
Views: 1081
Reputation: 2013
The warnings are displayed by javac, Ant is just forwarding them into the console. Ant cannot distinguish them between javac warnings and errors. But you can configure javac warning output. You can use the attribute 'nowarn' in the javac tasks.
<javac nowarn='on' .... />
You can also select exactly which warning you let to suppress. You have then to look into the javac documentation (look at the Xlint options), and use the 'compilerarg' element of the javac task.
<javac .... >
<compilerarg line="-Xlint:-deprecation"/>
</javac>
Upvotes: 1