打开maven的安装目录,找到conf/settings.xml,打开。
添加如下内容。
<mirror><id>osc</id><mirrorOf>*</mirrorOf><url>http://maven.oschina.net/content/groups/public/</url></mirror><mirror><id>alimaven</id><mirrorOf>centra</mirrorOf><name>aliyun maven</name><url>http://maven.aliyun.com/nexus/content/repositories/central/</url></mirror><mirror><id>nexus-aliyun</id><mirrorOf>*</mirrorOf><name>Nexus aliyun</name><url>http://maven.aliyun.com/nexus/content/groups/public</url></mirror><!-- 中央仓库1 --><mirror><id>repo1</id><mirrorOf>central</mirrorOf><name>Human Readable Name for this Mirror.</name><url>http://repo1.maven.org/maven2/</url></mirror><!-- 中央仓库2 --><mirror><id>repo2</id><mirrorOf>central</mirrorOf><name>Human Readable Name for this Mirror.</name><url>http://repo2.maven.org/maven2/</url></mirror>