On 25 June 2013 15:29, virg g <[email protected]> wrote: > Hi, I need build my project with multiple jdk versions 1.5 and 1.6. I am > using maven compiler plugin to set the compiler based on JAVA_HOME set. Is > it mandatory to set target either 1.5 or 1.6 based on the jdk version i > want to build. Why because if i set compiler to jdk 1.6, in the debug log > it shows that target is 1.5 but it should be 1.6 right? target should set > automatically based on JAVA_HOME right unless i specically mention the > target if i want to change? Any pointers for my problem? > > [DEBUG] (f) executable = D:/jdk1.6.0_14/bin/javac > [DEBUG] (f) source = 1.5 > [DEBUG] (f) staleMillis = 0 > [DEBUG] (f) target = 1.5
Did you see the docs? http://maven.apache.org/plugins/maven-compiler-plugin/examples/compile-using-different-jdk.html Tells you how to change the compiler http://maven.apache.org/plugins/maven-compiler-plugin/examples/set-compiler-source-and-target.html Tells you how to change the -source and -target arguments. You can run with a different JDK than the java class files being generated. i.e. JDK is 1.6 and output classes are 1.5 byte code. http://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html Tells you the default value for source (http://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#source) and target (http://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#target) is 1.5 --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
