簡體   English   中英

將Maven項目“ YCSB”導入Eclipse

[英]Import Maven project “YCSB” into Eclipse

有人可以告訴我將Maven項目(在我的情況下為YCSB)導入Eclipse Luna的正確方法嗎? 我正在嘗試通過Import > Maven > Existing Maven Projects Eclipse會導入所有文件夾和文件,但是每個文件夾POM.xml中都有一個錯誤。

Plugin execution not covered by lifecycle configuration:
org.apache.maven.plugins:maven-checkstyle-plugin:2.15:checkstyle (execution: validate, phase: validate)

我也不知道如何構建和運行該項目。 我通過使用目標clean package配置Maven運行配置並對其進行了嘗試。 構建失敗,並顯示以下控制台輸出。

[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.087 s
[INFO] Finished at: 2015-09-15T14:04:29+01:00
[INFO] Final Memory: 19M/170M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-surefire-plugin:2.12.4 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-surefire-plugin:jar:2.12.4: Could not transfer artifact org.apache.maven.plugins:maven-surefire-plugin:pom:2.12.4 from/to central (http://repo.maven.apache.org/maven2): repo.maven.apache.org: Der Name oder der Dienst ist nicht bekannt: Unknown host repo.maven.apache.org: Der Name oder der Dienst ist nicht bekannt -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException

使用命令行命令mvn clean package生成項目將生成項目而不會出現錯誤。

我的系統已安裝Ubuntu 14.04和Maven 3。

首先,這個錯誤

Plugin execution not covered by lifecycle configuration:
org.apache.maven.plugins:maven-checkstyle-plugin:2.15:checkstyle (execution: validate, phase: validate)

發生這種情況是因為您沒有在Eclipse中安裝“ Eclipse Checkstyle插件”。 在eclipse菜單中:Help-> install new software,進入該站點http://eclipse-cs.sourceforge.net/update search checkstyle並安裝此插件,pol.xml中的錯誤將全部消失。

二,這個錯誤

Plugin org.apache.maven.plugins:maven-surefire-plugin:2.12.4 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-surefire-plugin:jar:2.12.4: Could not transfer artifact org.apache.maven.plugins:maven-surefire-plugin:pom:2.12.4 from/to central (http://repo.maven.apache.org/maven2): repo.maven.apache.org: Der Name oder der Dienst ist nicht bekannt: Unknown host repo.maven.apache.org:
 Der Name oder der Dienst ist nicht bekannt-> [Help 1]

表示您的Internet連接已斷開,並且maven無法下載依賴的jar文件進行編譯。 檢查您的Internet連接或為Maven配置代理。 當上述操作失敗時,請使用mvn clean package編譯maven。您也可以使用mvn -pl com.yahoo.ycsb:mongodb-binding -am clean package僅編譯特定的數據庫綁定。

是的,這是在Eclipse中導入Maven項目的正確方法,但是您遇到了一些錯誤。 請在錯誤窗口(窗口->顯示視圖->常規->錯誤日志)上檢查錯誤,然后得到實際錯誤。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM