Maven的Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies的错误

益光亮
2023-12-01

错误:

当使用Maven的工具命令出现(错误):

error:Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or
 one of its dependencies could not be 
 resolved: Failed to read artifact descriptor 
 for org.apache.maven.plugins:maven-clean-plugin:jar:2.5: 
 Could not transfer artifact org.apache.maven.plugins:maven

说明我们的本地仓库中的Plugin(该目录下保存着工具命令的jar包)有问题。

解决办法:

找到本地仓库下的Plugin目录,并删除它。然后回到IDEA中,让IDEA重新去远程仓库中下载。
注意:该解决办法需要在Maven的setting.xml中配置了远程仓库

//阿里云的远程私有仓库
<mirrors>
    <mirror>
      <id>alimaven</id>
      <name>aliyun maven</name>
      <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
      <mirrorOf>central</mirrorOf>        
    </mirror>
  </mirrors>
 类似资料: