可以在settings.xml中的profile結點,來更改預設的Maven使用的jdk版本,否則將顯示預設的1.5版本。
1 <profile> 2 <id>jdk-1.7</id> 3 <activation> 4 <activeByDefault>true</activeByDefault> 5 <jdk>1.7</jdk> 6 </activation> 7 8 <properties> 9 <maven.compiler.source>1.7</maven.compiler.source> 10 <maven.compiler.target>1.7</maven.compiler.target> 11 <maven.compiler.compilerVersion>1.7</maven.compiler.compilerVersion> 12 </properties> 13 </profile>