How to compile using -Xlint:unchecked in a Maven project?

Alexis King picture Alexis King · Sep 16, 2012 · Viewed 31.6k times · Source

In NetBeans 7.2, I'm having trouble finding how to compile using -Xlint:unchecked in a Maven project. Under an Ant project, you can change compiler flags by going to Project Properties -> Compiling, but Maven projects don't seem to have any such option.

Is there any way to configure the IDE to compile with such flags using Maven?

Answer

Nishant picture Nishant · Sep 16, 2012

I guess you can set compiler arguments in your pom.xml. Please refer this http://maven.apache.org/plugins/maven-compiler-plugin/examples/pass-compiler-arguments.html

 <compilerArgument>-Xlint:unchecked</compilerArgument>