修改maven中setting配置
找到tomcat中conf下的setting.xml,找到<mirrors>下
<mirror>
<id>mirrorId</id>
<mirrorOf>repositoryId</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://my.repository.com/repo/path</url>;
</mirror>
<mirror>
<id>nexus-aliyun</id>
<mirrorOf>*</mirrorOf>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>;
</mirror>
如下:
然后,添加pom中配置
<repositories>
<repository>
<id>sonatype-nexus-snapshots</id>
<name>Sonatype Nexus Snapshots</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>;
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
保存退出,maven重新加载即可。
来源:oschina
链接:https://my.oschina.net/u/4271231/blog/4446199