How to suppress warnings during Javadoc compilation (within the scope of the code base)?
I'm stuck in a legacy java code base, and there will be thousands warnings when you compile it I am happy to actually address the root causes of all these warnings, but unfortunately, our company is not an option at present (others such as "making new products and generating revenue" are regarded as a higher priority by the person in charge)
Now, I can tolerate all these warnings, if not because they are difficult to find actual errors in the output of continuous build servers Building the server only uses an ant call, which is not fancy, but so far, I haven't found any place. I can modify this call to prevent warning output
Traversing the code and adding a @ suppresswarnings comment everywhere works, but it's the same pain to pass and fix all warning sources So what I really like is if there are some ways I can do:
<javadoc suppressWarrnings="true"
Or something like that so that the Javadoc compiler does not output all warning messages Can this be done (global Javadoc warning disabled)?
Solution
Neither the ant task nor the Javadoc tool itself can disable warnings globally
One possible solution I can think of is to run the Javadoc task as a separate ant call with other builds You can redirect ant to the log file instead of the console using the - logfile parameter