Pass javac -g option from command line with Maven

[Last Updated: Nov 4, 2018]


mvn -Dmaven.compiler.debuglevel=none clean install

Legal values for debuglevel are none or a comma-separated list of the following keywords: lines, vars, and source. If debug level is not specified, by default, nothing will be appended to -g.

We can also set javac -g option using maven-compiler-plugin specific compilerArgs element in pom.xml
<?xml version="1.0" encoding="UTF-8"?>



See Also