I would like to use java 7 in my tests and java 6 for the code. How to achieve this?
How to write Junit with Java 1.7 while running base code with 1.6
2k views Asked by pixel At
2
There are 2 answers
2
On
You can set the jvm that is used by the maven-surefire-plugin to point to the java 7 executable.
See http://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#jvm
You can also set source and target in the execution phase
testCompileof themaven-compiler-plugin. So try something like this