解决Idea中Cannot resolve plugin org.apache.maven.plugins:maven-clean-plugin:3.1.0配置问题

博客作者遇到在pom.xml中配置Spring Boot插件时出现错误,问题指向`maven-clean-plugin:3.1.0`无法解析。解决方法是修改maven的settings.xml文件,添加阿里云仓库镜像。具体操作包括在settings.xml中添加阿里云仓库配置,并在pom.xml里声明仓库和插件仓库,最后刷新Maven即可解决问题。
摘要由CSDN通过智能技术生成

在项目的pom.xml中,

```Java

<build>
   <plugins>
      <plugin>
         <groupId>org.springframework.boot</groupId>
         <artifactId>spring-boot-maven-plugin</artifactId>
         <version>2.4.4</version>
      </plugin>
   </plugins>
</build>

```

这段配置文件一直出错,显示Cannot resolve plugin org.apache.maven.plugins:maven-clean-plugin:3.1.0问题。博主折腾了一天才搞定,这种配置文件出问题真的太难解决了。。

解决方法:

首先在maven的配置文件夹下找到conf/seeting.xml文件,如下图所示:

然后修改里面的仓库文件,添加阿里云仓库,如下图

<id>alimaven</id>

<mirrorOf>central</mirrorOf>

<name>aliyun maven</name>

<url>http://maven.aliyun.com/repository/public</url>

</mirror>

然后再在pom.xml任意一个位置添加下面代码:

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

然后再点击maven刷新就可以了!

  • 13
    点赞
  • 29
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 7
    评论
评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

小小谢先生

支持知识付费

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值