繁体   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