brianfrankcooper / YCSB

Yahoo! Cloud Serving Benchmark
Apache License 2.0
4.96k stars 2.25k forks source link

Exception on Maven build: maven-checkstyle-plugin java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log #980

Open dineiar opened 7 years ago

dineiar commented 7 years ago

Providing context:

OS: Ubuntu 16.04

# mvn --version
Apache Maven 3.3.9
Maven home: /usr/share/maven
Java version: 1.8.0_131, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-openjdk-amd64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.4.0-77-generic", arch: "amd64", family: "unix"

I've just downloaded the code and tried to compile it, with the following commands:

wget https://github.com/brianfrankcooper/YCSB/archive/master.zip
unzip master.zip
cd YCSB-master
mvn clean package

And got the following error: Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:2.16:check (validate) on project root: Execution validate of goal org.apache.maven.plugins:maven-checkstyle-plugin:2.16:check failed: An API incompatibility was encountered while executing org.apache.maven.plugins:maven-checkstyle-plugin:2.16:check: java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;Ljava/lang/Throwable;)V

Raw maven output:

INFO: YCSB Root .......................................... FAILURE [  2.221 s]
INFO: Core YCSB .......................................... SKIPPED
INFO: Per Datastore Binding descriptor ................... SKIPPED
INFO: YCSB Datastore Binding Parent ...................... SKIPPED
INFO: <all bindings> ..................................... SKIPPED
INFO: YCSB Release Distribution Builder .................. SKIPPED
INFO: ------------------------------------------------------------------------
INFO: BUILD FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 3.561 s
INFO: Finished at: 2017-06-14T22:12:57-03:00
INFO: Final Memory: 16M/217M
INFO: ------------------------------------------------------------------------
SEVERE: Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:2.16:check (validate) on project root: Execution validate of goal org.apache.maven.plugins:maven-checkstyle-plugin:2.16:check failed: An API incompatibility was encountered while executing org.apache.maven.plugins:maven-checkstyle-plugin:2.16:check: java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;Ljava/lang/Throwable;)V
SEVERE: -----------------------------------------------------
SEVERE: realm =    plugin>org.apache.maven.plugins:maven-checkstyle-plugin:2.16
SEVERE: strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
SEVERE: urls[0] = file:/home/cloud/.m2/repository/org/apache/maven/plugins/maven-checkstyle-plugin/2.16/maven-checkstyle-plugin-2.16.jar
SEVERE: urls[1] = file:/home/cloud/.m2/repository/org/slf4j/slf4j-jdk14/1.5.6/slf4j-jdk14-1.5.6.jar
SEVERE: urls[2] = file:/home/cloud/.m2/repository/org/slf4j/jcl-over-slf4j/1.5.6/jcl-over-slf4j-1.5.6.jar
SEVERE: urls[3] = file:/home/cloud/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar
SEVERE: urls[4] = file:/home/cloud/.m2/repository/commons-cli/commons-cli/1.2/commons-cli-1.2.jar
SEVERE: urls[5] = file:/home/cloud/.m2/repository/org/codehaus/plexus/plexus-interactivity-api/1.0-alpha-4/plexus-interactivity-api-1.0-alpha-4.jar
SEVERE: urls[6] = file:/home/cloud/.m2/repository/backport-util-concurrent/backport-util-concurrent/3.1/backport-util-concurrent-3.1.jar
SEVERE: urls[7] = file:/home/cloud/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar
SEVERE: urls[8] = file:/home/cloud/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
SEVERE: urls[9] = file:/home/cloud/.m2/repository/org/apache/maven/reporting/maven-reporting-api/3.0/maven-reporting-api-3.0.jar
SEVERE: urls[10] = file:/home/cloud/.m2/repository/org/apache/maven/reporting/maven-reporting-impl/2.3/maven-reporting-impl-2.3.jar
SEVERE: urls[11] = file:/home/cloud/.m2/repository/org/apache/maven/shared/maven-shared-utils/0.6/maven-shared-utils-0.6.jar
SEVERE: urls[12] = file:/home/cloud/.m2/repository/com/google/code/findbugs/jsr305/2.0.1/jsr305-2.0.1.jar
SEVERE: urls[13] = file:/home/cloud/.m2/repository/org/apache/maven/doxia/doxia-core/1.2/doxia-core-1.2.jar
SEVERE: urls[14] = file:/home/cloud/.m2/repository/xerces/xercesImpl/2.9.1/xercesImpl-2.9.1.jar
SEVERE: urls[15] = file:/home/cloud/.m2/repository/xml-apis/xml-apis/1.3.04/xml-apis-1.3.04.jar
SEVERE: urls[16] = file:/home/cloud/.m2/repository/org/apache/httpcomponents/httpclient/4.0.2/httpclient-4.0.2.jar
SEVERE: urls[17] = file:/home/cloud/.m2/repository/org/apache/httpcomponents/httpcore/4.0.1/httpcore-4.0.1.jar
SEVERE: urls[18] = file:/home/cloud/.m2/repository/commons-codec/commons-codec/1.3/commons-codec-1.3.jar
SEVERE: urls[19] = file:/home/cloud/.m2/repository/commons-validator/commons-validator/1.3.1/commons-validator-1.3.1.jar
SEVERE: urls[20] = file:/home/cloud/.m2/repository/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar
SEVERE: urls[21] = file:/home/cloud/.m2/repository/commons-digester/commons-digester/1.6/commons-digester-1.6.jar
SEVERE: urls[22] = file:/home/cloud/.m2/repository/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar
SEVERE: urls[23] = file:/home/cloud/.m2/repository/org/apache/maven/doxia/doxia-sink-api/1.4/doxia-sink-api-1.4.jar
SEVERE: urls[24] = file:/home/cloud/.m2/repository/org/apache/maven/doxia/doxia-logging-api/1.4/doxia-logging-api-1.4.jar
SEVERE: urls[25] = file:/home/cloud/.m2/repository/org/apache/maven/doxia/doxia-decoration-model/1.4/doxia-decoration-model-1.4.jar
SEVERE: urls[26] = file:/home/cloud/.m2/repository/org/apache/maven/doxia/doxia-site-renderer/1.4/doxia-site-renderer-1.4.jar
SEVERE: urls[27] = file:/home/cloud/.m2/repository/org/apache/maven/doxia/doxia-module-xhtml/1.4/doxia-module-xhtml-1.4.jar
SEVERE: urls[28] = file:/home/cloud/.m2/repository/org/apache/maven/doxia/doxia-module-fml/1.4/doxia-module-fml-1.4.jar
SEVERE: urls[29] = file:/home/cloud/.m2/repository/org/codehaus/plexus/plexus-i18n/1.0-beta-7/plexus-i18n-1.0-beta-7.jar
SEVERE: urls[30] = file:/home/cloud/.m2/repository/org/apache/velocity/velocity-tools/2.0/velocity-tools-2.0.jar
SEVERE: urls[31] = file:/home/cloud/.m2/repository/commons-chain/commons-chain/1.1/commons-chain-1.1.jar
SEVERE: urls[32] = file:/home/cloud/.m2/repository/dom4j/dom4j/1.1/dom4j-1.1.jar
SEVERE: urls[33] = file:/home/cloud/.m2/repository/sslext/sslext/1.2-0/sslext-1.2-0.jar
SEVERE: urls[34] = file:/home/cloud/.m2/repository/org/apache/struts/struts-core/1.3.8/struts-core-1.3.8.jar
SEVERE: urls[35] = file:/home/cloud/.m2/repository/org/apache/struts/struts-taglib/1.3.8/struts-taglib-1.3.8.jar
SEVERE: urls[36] = file:/home/cloud/.m2/repository/org/apache/struts/struts-tiles/1.3.8/struts-tiles-1.3.8.jar
SEVERE: urls[37] = file:/home/cloud/.m2/repository/org/apache/maven/doxia/doxia-integration-tools/1.6/doxia-integration-tools-1.6.jar
SEVERE: urls[38] = file:/home/cloud/.m2/repository/commons-io/commons-io/1.4/commons-io-1.4.jar
SEVERE: urls[39] = file:/home/cloud/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
SEVERE: urls[40] = file:/home/cloud/.m2/repository/org/codehaus/plexus/plexus-resources/1.0.1/plexus-resources-1.0.1.jar
SEVERE: urls[41] = file:/home/cloud/.m2/repository/org/codehaus/plexus/plexus-utils/3.0.20/plexus-utils-3.0.20.jar
SEVERE: urls[42] = file:/home/cloud/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.21/plexus-interpolation-1.21.jar
SEVERE: urls[43] = file:/home/cloud/.m2/repository/org/codehaus/plexus/plexus-velocity/1.1.8/plexus-velocity-1.1.8.jar
SEVERE: urls[44] = file:/home/cloud/.m2/repository/com/puppycrawl/tools/checkstyle/6.2/checkstyle-6.2.jar
SEVERE: urls[45] = file:/home/cloud/.m2/repository/antlr/antlr/2.7.7/antlr-2.7.7.jar
SEVERE: urls[46] = file:/home/cloud/.m2/repository/org/antlr/antlr4-runtime/4.3/antlr4-runtime-4.3.jar
SEVERE: urls[47] = file:/home/cloud/.m2/repository/org/abego/treelayout/org.abego.treelayout.core/1.0.1/org.abego.treelayout.core-1.0.1.jar
SEVERE: urls[48] = file:/home/cloud/.m2/repository/org/antlr/antlr4-annotations/4.3/antlr4-annotations-4.3.jar
SEVERE: urls[49] = file:/home/cloud/.m2/repository/commons-beanutils/commons-beanutils-core/1.8.3/commons-beanutils-core-1.8.3.jar
SEVERE: urls[50] = file:/home/cloud/.m2/repository/com/google/guava/guava/18.0/guava-18.0.jar
SEVERE: urls[51] = file:/home/cloud/.m2/repository/org/apache/velocity/velocity/1.5/velocity-1.5.jar
SEVERE: urls[52] = file:/home/cloud/.m2/repository/commons-lang/commons-lang/2.1/commons-lang-2.1.jar
SEVERE: urls[53] = file:/home/cloud/.m2/repository/oro/oro/2.0.8/oro-2.0.8.jar
SEVERE: urls[54] = file:/home/cloud/.m2/repository/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar
SEVERE: Number of foreign imports: 1
SEVERE: import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
SEVERE: 
SEVERE: -----------------------------------------------------
SEVERE: -> [Help 1]
SEVERE: 
SEVERE: To see the full stack trace of the errors, re-run Maven with the -e switch.
SEVERE: Re-run Maven using the -X switch to enable full debug logging.
SEVERE: 
SEVERE: For more information about the errors and possible solutions, please read the following articles:
SEVERE: [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginContainerException

I've found this completely unrelated issue that describes a similar error, and I applied the solution pointed out by @jcgay:

Edit YCSB-master/pom.xml changing:

<plugins>
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>2.16</version>
    </plugin>
</plugins>

to:

<plugins>
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>2.16</version>
        <dependencies>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>jcl-over-slf4j</artifactId>
                <version>1.7.5</version>
            </dependency>
        </dependencies>
    </plugin>
</plugins>

And voilà, the build process worked.

Now, is it an issue that should be fixed on pom.xml or I just made a big mess and simply did't get it?

busbey commented 7 years ago

what's the output of mvn -version ?

busbey commented 7 years ago

nevermind now I see it. :)

busbey commented 6 years ago

fix will be one of: