在pom.xml添加plugin
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>2.5.1</version> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin>
原文地址:http://www.cnblogs.com/yiban/p/maven_jdk_version.html