目录
一、settings.xml配置
找到maven安装目录下的conf/settings.xml,打开。
1)配置本地仓库。添加<localRepository>仓库路径</localRepository>
2)使用阿里云的中央仓库。在<mirrors></mirror>标签里面添加如下内容:
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
3)JDK配置。在<profiles></profiles>标签中添加如下内容:
<profile>
<id>jdk1.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>
二、MyEclipse配置
1)window->preferences->Maven->Installations
2)User Settings。
3) java->Installed JREs。在Default VM Arguments中输入“-Dmaven.multiModuleProjectDirectory=M2_HOME”