新装mvn建第一个项目报错org.apache.maven.plugins:maven-resources-plugin:2.6

 2023-02-26    420  

1、第一次创建mvn项目会报maven-resources-plugin-2.6.jar错,原因是mvn无法自动下载这个jar包,多次删除这个目录下的C:\Users\Administrator\.m2\repository\org\apache\maven\plugins(你自己的目录)所有文件(有时候会解决,有的时候不会解决这个问题),自动下载maven-resources-plugin-2.6.jar还是不行(多次从装都没有这个问题,最近换了网络,估计是网络不行造成的)。

2、解决方法:在mvn项目下pom.xml文件下手动

新装mvn建第一个项目报错org.apache.maven.plugins:maven-resources-plugin:2.6

项目有jar包可以直接在里边加上这段

<dependency>

  <groupId>org.apache.maven.plugins</groupId>
   <artifactId>maven-resources-plugin</artifactId>
   <version>2.6</version>
</dependency>

如果是新装没有jar包的话直接输入会报错

 加一个标签即可

<dependencies>

   <dependency>

     <groupId>org.apache.maven.plugins</groupId>
     <artifactId>maven-resources-plugin</artifactId>
     <version>2.6</version>
    </dependency>

</dependencies>

在建好的mvn项目上run as –》maven install下载即可

3、总结大部分出现这种错误的直接删除1、中的目录下文件 新建mvn项目即可解决,如果无法解决请按照2、进行操作即可。

我的报错信息如下:

“`java

Errors occurred during the build.
Errors running builder ‘Maven Project Builder’ on project ‘shouka_merchant’.
Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6
Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6
Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6
Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6
Errors running builder ‘Maven Project Builder’ on project ‘shouka_new’.
Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6
Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6
Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6
Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6

以上所述是小编给大家介绍的新装mvn建第一个项目报错org.apache.maven.plugins:maven-resources-plugin:2.6,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对77isp云服务器技术网的支持!

原文链接:https://www.77isp.com/post/34631.html

=========================================

https://www.77isp.com/ 为 “云服务器技术网” 唯一官方服务平台,请勿相信其他任何渠道。