idea中maven项目依赖下不下来,标红线

我的解决方案:

  1. 在maven的配置文件中settings.xml加入镜像
<mirror>
	<id>nexus-aliyun</id>
	<mirrorOf>*</mirrorOf>
	<name>Nexus aliyun</name>
	<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
  1. 在项目中的pom.xml文件中配置一个阿里云的远程仓库(也可以在settings.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>

经过这两步,然后下载一下maven依赖并引入就可以了

其实主要是依赖下不下来,想办法下下来就行

发布了169 篇原创文章 · 获赞 1 · 访问量 3614

猜你喜欢

转载自blog.csdn.net/weixin_43871678/article/details/104170974