有人能告诉我将 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)
我也不知道如何构建和运行该项目。我通过使用目标配置 Maven 运行配置并进行了clean package
编译来尝试它。构建失败并显示以下控制台输出。
[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。