当前位置:首页 > 服务端 > 新装mvn建第一个项目报错org.apache.maven.plugins:maven-resources-plugin:2.6

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

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文件下手动

项目有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

作者:星朝
来源链接:https://www.cnblogs.com/jpfss/p/9100162.html

版权声明:
1、Java侠(https://www.javaxia.com)以学习交流为目的,由作者投稿、网友推荐和小编整理收藏优秀的IT技术及相关内容,包括但不限于文字、图片、音频、视频、软件、程序等,其均来自互联网,本站不享有版权,版权归原作者所有。

2、本站提供的内容仅用于个人学习、研究或欣赏,以及其他非商业性或非盈利性用途,但同时应遵守著作权法及其他相关法律的规定,不得侵犯相关权利人及本网站的合法权利。
3、本网站内容原作者如不愿意在本网站刊登内容,请及时通知本站(javaclubcn@163.com),我们将第一时间核实后及时予以删除。





本文链接:https://www.javaxia.com/server/125364.html

分享给朋友:

“新装mvn建第一个项目报错org.apache.maven.plugins:maven-resources-plugin:2.6” 的相关文章