關於maven工程的幾個BUG


換了個新的環境,重新導入的maven工程出現了2個BUG:

1、Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of內容很長,只截取了前面部分

 

2、Failure to transfer org.apache.maven.plugins:maven-surefire-plugin:pom:2.12.4 from http://maven.aliyun.com/nexus/content/groups/public was cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven.plugins:maven-surefire-plugin:pom:2.12.4 from/to nexus (http://maven.aliyun.com/nexus/content/groups/public): maven.aliyun.com。

 

3、The project cannot be built until build path errors are resolved

 

4、Could not calculate build plan: Failure to transfer org.apache.maven.plugins:maven-surefire-plugin:pom:2.7.1 from http://repo1.maven.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven.plugins:maven-surefire-plugin:pom:2.7.1 from/to central (http://repo1.maven.org/maven2): Access denied to http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/2.7.1/maven-surefire-plugin-2.7.1.pom. Error code 407, Proxy Authentication Required 

解決方法如下:

1、

(1)將D:\Repositories\.m2\repository\org\apache\maven\plugins文件夾下的文件夾全部刪除就可以了

(默認地址在C:\User\.m2\repository\org\apache\maven\plugins目錄下的文件夾下)

(2)然后右擊項目Maven->Update Project  或者Alt+F5

 

2、關於這個本人走了點彎路,以為是阿里雲鏡像配置有問題,換了幾個版本結果都一樣例如

 1      <!-- 阿里雲鏡像 下載配置 -->
 2      <mirror>
 3       <id>alimaven</id>
 4       <mirrorOf>central</mirrorOf>        
 5       <name>aliyun maven</name>
 6       <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
 7     </mirror>
 8 <!--      <mirror>
 9         <id>nexus-aliyun</id>
10         <mirrorOf>central</mirrorOf>
11         <name>Nexus aliyun</name>
12         <url>http://maven.aliyun.com/nexus/content/groups/public</url>
13     </mirror> -->
View Code

后來查明原因是因為已經存在一個下載失敗的版本導致,需找到文件所在目錄,手動刪除

(1)本人的存在地址為D:\Repositories\.m2\repository\com下的google文件夾,刪除。

(2)然后右擊項目Maven->Update Project  或者Alt+F5

 

3、這個問題類似上面的,也是下載的文件不存在或沒下完整造成的。

找到錯誤JAR包存放的地方,手動刪除,重新加載依賴下載即可解決。

 

4、

解決方法如下:

(1)將C:\User\.m2\repository\org\apache\maven\plugins\maven-deploy-plugin目錄下的文件夾刪除,

(2)然后右擊項目Maven->Update Project->Update Dependencies,重點要勾選下面的Force Update of Snapshots/Release。

 

問題解決。

 


免責聲明!

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



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