How to compile using -Xlint:unchecked in a Maven project?
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>
I want to elaborate on @Nishant's answer. The compilerArgument
tag needs to go inside plugin/configuration
tag. Here is a full example:
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<testSource>1.8</testSource>
<testTarget>1.8</testTarget>
<compilerArgument>-Xlint:unchecked</compilerArgument>
</configuration>
</plugin>
</plugins>