maven下载jar包速度太慢的解决方法

1.在maven的settings.xml中添加镜像配置

<mirror>
      <id>alimaven</id>
      <name>aliyun maven</name>
      <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
      <mirrorOf>central</mirrorOf>       
</mirror>

2.添加后发现还是没起作用,还需要在项目的pom.xml中添加以下配置

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

猜你喜欢

转载自blog.csdn.net/wzl1217333452/article/details/106692522