【idea】pom.xml中的maven依赖引入问题

在gitee上下载的项目,pom.xml中的maven依赖引入爆红

一、问题

(1)第一个报错

Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:2.2.4.RELEASE from/to central (https://repo.maven.apache.org/maven2): Transfer failed for https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-starter-parent/2.2.4.RELEASE/spring-boot-starter-parent-2.2.4.RELEASE.pom

找了很多的方法,可能是版本的问题,我就将版本号改成了2.1.0,确实解决了这一个报错,Ctrl+点击spring-boot-starter-parent,也能正常跳转了,但是Ctrl+点击spring-boot-configuration-processor还是不行,出现了第二个报错

(2)第二个报错

Could not transfer artifact org.springframework.boot:spring-boot-dependencies:pom:2.1.0.RELEASE from/to central (https://repo.maven.apache.org/maven2): GET request of: org/springframework/boot/spring-boot-dependencies/2.1.0.RELEASE/spring-boot-dependencies-2.1.0.RELEASE.pom from central failed

问了chatgpt

1.首先报错的网站,我可以通过浏览器进入,说明我的网络是没有问题的;

2.我的镜像是阿里云

​

<mirrors>
        <mirror>
            <id>alimaven</id>
            <name>aliyun maven</name>
            <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
            <mirrorOf>central</mirrorOf>
        </mirror>
        <mirror>
            <id>ui</id>
            <mirrorOf>central</mirrorOf>
            <name>Human Readable Name for this Mirror.</name>
            <url>http://uk.maven.org/maven2/</url>
        </mirror>
        <mirror>
            <id>jboss-public-repository-group</id>
            <mirrorOf>central</mirrorOf>
            <name>JBoss Public Repository Group</name>
            <url>http://repository.jboss.org/nexus/content/groups/public</url>
        </mirror>
        <mirror>
            <id>repo2</id>
            <mirrorOf>central</mirrorOf>
            <name>Human Readable Name for this Mirror.</name>
            <url>http://repo2.maven.org/maven2/</url>
        </mirror>
        <mirror>
            <id>OSChina</id>
            <name>OSChina Central</name>
            <url>http://maven.oschina.net/content/groups/public/</url>
            <mirrorOf>central</mirrorOf>
        </mirror>
        <mirror>
            <id>nexus-osc-thirdparty</id>
            <mirrorOf>thirdparty</mirrorOf>
            <name>Nexus osc thirdparty</name>
            <url>http://maven.oschina.net/content/repositories/thirdparty/</url>
        </mirror>
    </mirrors>

[点击并拖拽以移动]
​

3.版本我也已经下降了

4.maven配置

idea的左上角的file->setting,然后按照图上的配置

-Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true

5.释放缓存

最后问题还是没有解决!!!

二、解决方法

我发现我报错中的网址不是阿里云镜像网站,参考这个http://t.csdnimg.cn/DWgCi文章,在在项目的pom.xml中添加如下配置

  <repositories>
    <repository>
      <id>central</id>
      <url>https://maven.aliyun.com/repository/public</url>
    </repository>
  </repositories>
  <pluginRepositories>
    <pluginRepository>
      <id>central</id>
      <url>https://maven.aliyun.com/repository/public</url>
    </pluginRepository>
  </pluginRepositories>

最后让maven重新加载,终于解决了爆红问题,依赖正常引入

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值