您的位置:首页 > 其它

配置阿里云maven仓库

2016-11-01 15:18 441 查看
第一步

在maven的setting.xml文件中的
<profiles></profiles>
标签中配置如下:

<profile>
<id>dev</id>

<repositories>
<repository>
<id>nexus</id>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>

<pluginRepositories>
<pluginRepository>
<id>nexus</id>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>


第二步

在maven的setting.xml文件中配置如下(使第二步的配置起作用,

至于在哪配置,在setting.xml中是有示例的,自己找找):

<activeProfiles>
<activeProfile>dev</activeProfile>
</activeProfiles>


这样,在pom.xml中依赖的库就会从阿里云的maven库中去下载,感觉上速度会快不少。

如果使用Eclipse,需要指定你的setting.xml后点击update settings按钮才会生效,如下图所示:

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  maven 阿里云 nexus