解决IDEA无法下载maven依赖的问题

网友投稿 1097 2023-04-17

解决IDEA无法-maven依赖的问题

解决IDEA无法-maven依赖的问题

今天新建一个springboot项目时,项目建好后,在IDEA-依赖包时,-了很久都没有-完,后来仔细一看,是-不了。

解决方法

在项目的pom.xml文件上右键,弹出框中选择maven,再选择open 'settings.xml'  或者是 create 'settings.xml' ,操作如图:

在该文件中填入如下内容:

xmlns:xsi="http://w3.org/2001/XMLSchema-instance"

xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">

nexus

internal nexus repository

http://repo.maven.apache.org/maven2

central

xmlns:xsi="http://w3.org/2001/XMLSchema-instance"

xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">

nexus

internal nexus repository

http://repo.maven.apache.org/maven2

central

重新右键pom.xml文件,选择 maven ,选择 Reimport 即可-依赖。操作步骤及settings.xml文件内容如图:

settings.xml文件内容:

至此,依赖依法-的问题已经解决。。

疑惑:将settings.xml文件中的替换成如下内容,竟然也无法-依赖(但看网上博客说会让-速度变快的)

alimaven

aliyun maven

http://maven.aliyun.com/nexus/content/groups/public/

central

uk

central

Human Readable Name for this Mirror.

http://uk.maven.org/maven2/

CN

OSChina Central

http://maven.oschina-/content/groups/public/

central

nexus

internal nexus repository

http://repo.maven.apache.org/maven2

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:Maven中jar包冲突原理与解决办法
下一篇:IDEA实现远程调试步骤详解
相关文章

 发表评论

暂时没有评论,来抢沙发吧~