eclipse導入mavn工程報Failure to transfer org.apache.maven.plugins:maven-resources-plugin:pom:2.6 的解決辦法


詳細報錯:

Failure to transfer org.apache.maven.plugins:maven-resources-plugin:pom:2.6 from http://10.74.156.84:8085/nexus/content/groups/public/ was cached in the
local repository, resolution will not be reattempted until the update interval of U32_PUBLIC has elapsed or updates are forced. Original error: Could not
transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.6 from/to U32_PUBLIC (http://10.74.156.84:8085/nexus/content/groups/public/):
connect timed out

 

錯誤信息出現在pom頭的project標簽,project標簽內容是

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

 

原因

這是由於缺少maven-resources-plugin-2.6.jar文件。這個文件是在{user.home}\.m2\repository\org\apache\maven\plugins\maven-resources-plugin\下。{user.home}是maven的配置路徑,一般是我的文檔,是window-preferences-MyEclipse-Maven4MyEclipse-User Setting里面的Local Repository。

 

解決方案

1、在pom.xml文件中加入maven-resources-plugin配置

 

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

  

2、在命令行下運行mvn install ,如果執行正確應該會在{user.home}\.m2\repository\org\apache\maven\plugins\maven-resources-plugin\下看到maven-resources-plugin-2.6.jar文件

 

3、刷新工程(右鍵工程選擇刷新項)

4、刷新maven配置,右鍵工程節點,選擇Maven4MyEclipse-Update Project Configuration

 


免責聲明!

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



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