在Maven中,默认的版本为1.5。而常用的版本一般为1.8。所以有时使用起来就很不方便。这样就需要修改maven的默认版本。
- 修改Maven的setting.xml文件
<profile>
<id>jdk-1.8</id>
<activation>
<activeByDefault>true</activeByDefault>
<jdk>1.8</jdk>
</activation>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
</properties>
</profile>