The maven-compiler-plugin allows one to set the maven.compiler.target property 
in the POM, the value of which is in turn passed as the -target argument to the 
Java compiler. I would like to be able to set this maven.compiler.target on the 
command-line instead, as follows:

mvn clean compile -Dmaven.compiler.target=1.5

However, when I try this it seems to have no effect on the compiled class 
files. Furthermore, when I set -Dmaven.compiler.target to some illegal value 
the build still succeeds and the class files still have the same minor and 
major version numbers (as shown by javap). All of this leads me to believe that 
the -Dmaven.compiler.target property being passed on the command-line is being 
ignored.

Is there any way to set the value of the -target compiler parameter from the 
mvn command-line?

-- 
Jason Voegele
Parents often talk about the younger generation as if they didn't have
much of anything to do with it.

Reply via email to