1.下载maven的zip包,官网下载地址:
https://maven.apache.org/download.cgi
2.将zip包解压到开发环境目录:
如D:/devtools1.8/maven3.5.4
3.找到解压目录的/conf/settings.xml文件,打开,增加如下配置:
<localRepository>D:/devtools1.8/maven/repository</localRepository>
<mirrors>
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
<mirror>
<id>UK</id>
<mirrorOf>central</mirrorOf>
<url>http://uk.maven.org/maven2</url>
</mirror>
<mirror>
<id>net-cn</id>
<mirrorOf>central</mirrorOf>
<url>http://maven.net.cn/content/groups/public/</url>
</mirror>
<mirror>
<id>osc</id>
<mirrorOf>central</mirrorOf>
<url>http://maven.oschina.net/content/groups/public/</url>
</mirror>
<mirror>
<id>osc_thirdparty</id>
<mirrorOf>thirdparty</mirrorOf>
<url>http://maven.oschina.net/content/repositories/thirdparty/</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>osc</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>osc</id>
<url>http://maven.oschina.net/content/groups/public/</url>
</repository>
<repository>
<id>osc_thirdparty</id>
<url>http://maven.oschina.net/content/repositories/thirdparty/</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>osc</id>
<url>http://maven.oschina.net/content/groups/public/</url>
</pluginRepository>
</pluginRepositories>
</profile>
<profile>
<id>net-cn</id>
<repositories>
<repository>
<id>net-cn</id>
<url>http://maven.net.cn/content/groups/public/</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>net-cn</id>
<url>http://maven.net.cn/content/groups/public/</url>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
4.eclipse引入maven,打开“window--Perferences”,找到“Maven--Installations”,引入上面下载的maven:
5.eclipse确认maven的settings.xml引用和仓库地址配置是否正确:
2018-12-08