2011-09-15 112 views
10

我有安裝Maven項目沒有本地日食,這是succefully完成。 現在我已經下載了Eclipse indgo 3.7.0。由於Eclipse的靛藍是有M2E(行家2蝕)插件啓用它通過M2E Eclipse的靛藍給出錯誤

Eclipse的>幫助 - >安裝新的軟件 - >與(靛藍工作 - http://download.eclipse.org/releases/indigo)->通用工具 - > M2E(檢查)和安裝。

在Eclipse

添加項目作爲作爲Maven項目,但在運行pom.xml文件中我得到的錯誤:

Downloading: http://mirrors.ibiblio.org/pub/mirrors/maven2/org/apache/maven/plugins/maven-resources-plugin/2.4.3/maven-resources-plugin-2.4.3.pom 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 0.625s 
[INFO] Finished at: Thu Sep 15 12:33:01 CEST 2011 
[INFO] Final Memory: 5M/15M 
[INFO] ------------------------------------------------------------------------ 
[ERROR] Plugin org.apache.maven.plugins:maven-resources-plugin:2.4.3 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.4.3: Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.4.3 from/to ibiblio.org (http://mirrors.ibiblio.org/pub/mirrors/maven2): null to http://mirrors.ibiblio.org/pub/mirrors/maven2/org/apache/maven/plugins/maven-resources-plugin/2.4.3/maven-resources-plugin-2.4.3.pom: UnresolvedAddressException -> [Help 1] 
[ERROR] 

這是M2E插件的問題,我怎麼能解決這個錯誤

也?在導入現有的Maven項目時遇到以下錯誤噸至蝕:

Could not calculate build plan 
Plugin org.apache.maven.plugins:maven-resources-plugin:2.4.1 or one of its dependencies 
could not be resolved: Transfer error: null 
org.apache.maven.plugins:maven-resources-plugin:maven-plugin:2.4.1 

from the specified remote repositories: 
ibiblio.org (http://mirrors.ibiblio.org/pub/mirrors/maven2, releases=true, snapshots=false) 
Description Resource Path Location Type 
Could not calculate build plan: Failure to transfer org.apache.maven.plugins:maven-resources-plugin:pom:2.4.3 
    from http://mirrors.ibiblio.org/pub/mirrors/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of ibiblio.org has elapsed or 
    updates are forced. Original error: Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.4.3 from/to ibiblio.org 
    (http://mirrors.ibiblio.org/pub/mirrors/maven2): null to http://mirrors.ibiblio.org/pub/mirrors/maven2/org/apache/maven/plugins/maven-resources-plugin/2.4.3/maven-resources- 
    plugin-2.4.3.pom my-app  Unknown Maven Problem 

的pom.xml:

<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"> 
    <modelVersion>4.0.0</modelVersion> 
    <groupId>com.test.myapp</groupId> 
    <artifactId>my-app</artifactId> 
    <version>1.0-SNAPSHOT</version> 
    <packaging>jar</packaging> 
    <name>my-app</name> 
    <url>http://maven.apache.org</url> 
    <properties> 
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
    </properties> 
</project> 
+4

請問你的settings.xml文件看起來像給出?在我看來,你以某種方式改變了settings.xml中......但你不應該引起ibiblio上沒有Maven的中央我建議改用http://repo1.maven.org/maven2/。 – khmarbaise

+0

您是否檢查過在命令行上構建您的項目只是mvn clean package? – khmarbaise

+0

@khmarbaise,從CMD maven工作正常。唯一的問題是與Eclipse插件m2e。 – TechFind

回答

1

Eclipse有一個內置的Maven的實現。嘗試使用與Eclipse相同的Maven版本從命令行編譯項目,或者在Eclipse中設置Maven安裝(Window/Preferences/Maven/Installations)。

+0

當我從CMD它工作正常,因爲我在我的問題已經通知編譯 – TechFind

+0

你的命令版本Maven和Eclipse一樣嗎? (通常爲3.0-SNAPSHOT)您是否嘗試更改Eclipse的Maven? – palacsint

+0

我已經從eclipse-> window-> preference-> Maven-> user settings更改了repository location和settings.xml。我如何在eclipse中更改maven位置? – TechFind

5

檢查本地存儲庫下org/apache/maven/plugins/maven-resources-plugin/的sha1校驗和,並刪除maven-resources-plugin目錄(如果它們中的任何一個錯誤)。或者直接刪除該目錄,然後讓Maven再次下載它。