How to write Junit with Java 1.7 while running base code with 1.6 -


i use java 7 in tests , java 6 code. how achieve this?

you can set source , target in execution phase testcompile of maven-compiler-plugin. try this

<plugin>     <groupid>org.apache.maven.plugins</groupid>     <artifactid>maven-compiler-plugin</artifactid>     <executions>        <execution>            <id>testcompilewithjdk7</id>            <phase>test-compile</phase>            <configuration>               <source>1.7</source>               <target>1.7</target>                          </configuration>         </execution>     </executions> </plugin> 

Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -