新裝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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM