方案一:修改settings文件 apache
<profiles> maven
<profile> ui
<id>jdk-1.6</id> spa
<activation> orm
<activeByDefault>true</activeByDefault> get
<jdk>1.6</jdk> it
</activation> io
<properties> jdk
<maven.compiler.source>1.6</maven.compiler.source> file
<maven.compiler.target>1.6</maven.compiler.target>
<maven.compiler.compilerVersion>1.6</maven.compiler.compilerVersion>
</properties>
</profile>
</profiles>
方案二:修改項目下的pom文件
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
方案三:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<!-- <version>2.0.2</version> 這個版本也能夠不加 -->
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>