简体   繁体   中英

Import Maven project “YCSB” into Eclipse

Can someone tell me the right way to import a Maven Project (in my case YCSB) into Eclipse Luna? I am trying it via Import > Maven > Existing Maven Projects . Eclipse imports all the folders and files, but there is an error in every folders POM.xml.

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

Also I have no idea how to build and run the the project. I tried it by configuring a Maven Run Configuration with the goals clean package and compiled. The Build fails with following Console output.

[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

Building the project with the commandline command mvn clean package builds the project without an error.

My system has Ubuntu 14.04 and Maven 3 installed.

First, This error

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

happend because you haven't the "Eclipse Checkstyle Plug-in" installed in eclipse. In eclipse menu:Help->install new software ,enter this site http://eclipse-cs.sourceforge.net/update search checkstyle and install this plugin,the error in your pol.xml will all disapear.

Second,this 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]

indicates that your internet connection is broken and maven can not download the dependent jar file for compiling. Check you internet connection or configure a proxy for maven. When the above is down, use mvn clean package to compile maven.You can also use mvn -pl com.yahoo.ycsb:mongodb-binding -am clean package to compile a certain database binding only.

yes it is right way to import maven project in eclipse but you got some errors. please check error on error window(window->show view ->General->error log) then you get actual error.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM