maven配置时使用国内镜像的方法
<?xml version="1.0" encoding="UTF-8"?> <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> <!-- 配置本地MAVEN仓库位置,默认在:C:\Users\机器名\.m2\repository <localRepository>D:\Program Files\mvn\</localRepository> ** Eclipse->Windows->Preferences->java->Build Path->Classpath Variables --> <pluginGroups> </pluginGroups> <proxies> </proxies> <servers> </servers> <!-- 注意这里,使用国内阿里镜像--> <mirrors> <mirror> <id>aliyun</id> <name>aliyun Maven</name> <mirrorOf>*</mirrorOf> <url>http://maven.aliyun.com/nexus/content/groups/public/</url> </mirror> </mirrors> <!-- 注意这里,使用国内阿里镜像--> <profiles> </profiles> <activeProfiles> </activeProfiles> </settings>
说明:最新版的Eclipse已经内嵌了Mevne插件m2e, 不需要安装Maven插件, 如果不做任何配置,<br>会自动连接使用maven中央库自然可以使用,但是中央库在国外, 受到中国防火墙等因素影<br>响其访问速度很慢, 只有连接到国内镜像库才能提高Maven运行速度. <br>连接到国内镜像库按照如下配置.