Mac上配置Eclipse中Maven的默认JDK版本
1、通过home brew命令:brew install maven 可安装maven。安装完后,通过mvn –v查看maven信息:

2、编辑/usr/local/Cellar/maven/3.5.0/libexec/conf/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>

3、打开Eclipse的偏好设置,选择Installations,通过Add按钮指定Maven目录,如下:

指定user settings:

2、编辑/usr/local/Cellar/maven/3.5.0/libexec/conf/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>
3、打开Eclipse的偏好设置,选择Installations,通过Add按钮指定Maven目录,如下:
指定user settings:
保存并关闭偏好。现在创建maven项目就使用JDK1.8了。