We can set Java compiler (javac) options and arguments in pom.xml.
javac
Use compilerArgs. This sets the arguments to be passed to the compiler.
compilerArgs
Example:
<build> <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> <encoding>UTF-8</encoding> <compilerArgs> <arg>-g</arg> <arg>-Xlint</arg> </compilerArgs> </configuration> </plugin> </plugins> </build>