question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

interference with maven-checkstyle-plugin

See original GitHub issue

Hi,

First thanks for such a cool plugin. I’m really enjoying it.

But maven-color causes maven-checkstyle-plugin to fail (I tried maven-checkstyle-plugin versions 2.13 to the current one 2.15. Version 2.12, and I assume any earlier version seems to work just fine). The output errors are:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:2.15:check (default-checkstyle) on project acomplii: Execution default-checkstyle of goal org.apache.maven.plugins:maven-checkstyle-plugin:2.15:check failed: An API incompatibility was encountered while executing org.apache.maven.plugins:maven-checkstyle-plugin:2.15:check: java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;Ljava/lang/Throwable;)V
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>org.apache.maven.plugins:maven-checkstyle-plugin:2.15
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/C:/Users/CRK/.m2/repository/org/apache/maven/plugins/maven-checkstyle-plugin/2.15/maven-checkstyle-plugin-2.15.jar
[ERROR] urls[1] = file:/C:/Users/CRK/.m2/repository/org/slf4j/slf4j-jdk14/1.5.6/slf4j-jdk14-1.5.6.jar
[ERROR] urls[2] = file:/C:/Users/CRK/.m2/repository/org/slf4j/jcl-over-slf4j/1.5.6/jcl-over-slf4j-1.5.6.jar
[ERROR] urls[3] = file:/C:/Users/CRK/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar
[ERROR] urls[4] = file:/C:/Users/CRK/.m2/repository/commons-cli/commons-cli/1.2/commons-cli-1.2.jar
[ERROR] urls[5] = file:/C:/Users/CRK/.m2/repository/org/codehaus/plexus/plexus-interactivity-api/1.0-alpha-4/plexus-interactivity-api-1.0-alpha-4.jar
[ERROR] urls[6] = file:/C:/Users/CRK/.m2/repository/backport-util-concurrent/backport-util-concurrent/3.1/backport-util-concurrent-3.1.jar
[ERROR] urls[7] = file:/C:/Users/CRK/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar
[ERROR] urls[8] = file:/C:/Users/CRK/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
[ERROR] urls[9] = file:/C:/Users/CRK/.m2/repository/org/apache/maven/reporting/maven-reporting-api/3.0/maven-reporting-api-3.0.jar
[ERROR] urls[10] = file:/C:/Users/CRK/.m2/repository/org/apache/maven/reporting/maven-reporting-impl/2.3/maven-reporting-impl-2.3.jar
[ERROR] urls[11] = file:/C:/Users/CRK/.m2/repository/org/apache/maven/shared/maven-shared-utils/0.6/maven-shared-utils-0.6.jar
[ERROR] urls[12] = file:/C:/Users/CRK/.m2/repository/com/google/code/findbugs/jsr305/2.0.1/jsr305-2.0.1.jar
[ERROR] urls[13] = file:/C:/Users/CRK/.m2/repository/org/apache/maven/doxia/doxia-core/1.2/doxia-core-1.2.jar
[ERROR] urls[14] = file:/C:/Users/CRK/.m2/repository/xerces/xercesImpl/2.9.1/xercesImpl-2.9.1.jar
[ERROR] urls[15] = file:/C:/Users/CRK/.m2/repository/xml-apis/xml-apis/1.3.04/xml-apis-1.3.04.jar
[ERROR] urls[16] = file:/C:/Users/CRK/.m2/repository/org/apache/httpcomponents/httpclient/4.0.2/httpclient-4.0.2.jar
[ERROR] urls[17] = file:/C:/Users/CRK/.m2/repository/org/apache/httpcomponents/httpcore/4.0.1/httpcore-4.0.1.jar
[ERROR] urls[18] = file:/C:/Users/CRK/.m2/repository/commons-codec/commons-codec/1.3/commons-codec-1.3.jar
[ERROR] urls[19] = file:/C:/Users/CRK/.m2/repository/commons-validator/commons-validator/1.3.1/commons-validator-1.3.1.jar
[ERROR] urls[20] = file:/C:/Users/CRK/.m2/repository/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar
[ERROR] urls[21] = file:/C:/Users/CRK/.m2/repository/commons-digester/commons-digester/1.6/commons-digester-1.6.jar
[ERROR] urls[22] = file:/C:/Users/CRK/.m2/repository/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar
[ERROR] urls[23] = file:/C:/Users/CRK/.m2/repository/org/apache/maven/shared/maven-shared-resources/2/maven-shared-resources-2.jar
[ERROR] urls[24] = file:/C:/Users/CRK/.m2/repository/org/apache/maven/doxia/doxia-sink-api/1.4/doxia-sink-api-1.4.jar
[ERROR] urls[25] = file:/C:/Users/CRK/.m2/repository/org/apache/maven/doxia/doxia-logging-api/1.4/doxia-logging-api-1.4.jar
[ERROR] urls[26] = file:/C:/Users/CRK/.m2/repository/org/apache/maven/doxia/doxia-decoration-model/1.4/doxia-decoration-model-1.4.jar
[ERROR] urls[27] = file:/C:/Users/CRK/.m2/repository/org/apache/maven/doxia/doxia-site-renderer/1.4/doxia-site-renderer-1.4.jar
[ERROR] urls[28] = file:/C:/Users/CRK/.m2/repository/org/apache/maven/doxia/doxia-module-xhtml/1.4/doxia-module-xhtml-1.4.jar
[ERROR] urls[29] = file:/C:/Users/CRK/.m2/repository/org/apache/maven/doxia/doxia-module-fml/1.4/doxia-module-fml-1.4.jar
[ERROR] urls[30] = file:/C:/Users/CRK/.m2/repository/org/codehaus/plexus/plexus-i18n/1.0-beta-7/plexus-i18n-1.0-beta-7.jar
[ERROR] urls[31] = file:/C:/Users/CRK/.m2/repository/org/apache/velocity/velocity-tools/2.0/velocity-tools-2.0.jar
[ERROR] urls[32] = file:/C:/Users/CRK/.m2/repository/commons-chain/commons-chain/1.1/commons-chain-1.1.jar
[ERROR] urls[33] = file:/C:/Users/CRK/.m2/repository/dom4j/dom4j/1.1/dom4j-1.1.jar
[ERROR] urls[34] = file:/C:/Users/CRK/.m2/repository/sslext/sslext/1.2-0/sslext-1.2-0.jar
[ERROR] urls[35] = file:/C:/Users/CRK/.m2/repository/org/apache/struts/struts-core/1.3.8/struts-core-1.3.8.jar
[ERROR] urls[36] = file:/C:/Users/CRK/.m2/repository/org/apache/struts/struts-taglib/1.3.8/struts-taglib-1.3.8.jar
[ERROR] urls[37] = file:/C:/Users/CRK/.m2/repository/org/apache/struts/struts-tiles/1.3.8/struts-tiles-1.3.8.jar
[ERROR] urls[38] = file:/C:/Users/CRK/.m2/repository/org/apache/maven/doxia/doxia-integration-tools/1.6/doxia-integration-tools-1.6.jar
[ERROR] urls[39] = file:/C:/Users/CRK/.m2/repository/commons-io/commons-io/1.4/commons-io-1.4.jar
[ERROR] urls[40] = file:/C:/Users/CRK/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
[ERROR] urls[41] = file:/C:/Users/CRK/.m2/repository/org/codehaus/plexus/plexus-resources/1.0.1/plexus-resources-1.0.1.jar
[ERROR] urls[42] = file:/C:/Users/CRK/.m2/repository/org/codehaus/plexus/plexus-utils/3.0.20/plexus-utils-3.0.20.jar
[ERROR] urls[43] = file:/C:/Users/CRK/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.21/plexus-interpolation-1.21.jar
[ERROR] urls[44] = file:/C:/Users/CRK/.m2/repository/org/codehaus/plexus/plexus-velocity/1.1.8/plexus-velocity-1.1.8.jar

[ERROR] urls[45] = file:/C:/Users/CRK/.m2/repository/com/puppycrawl/tools/checkstyle/6.1.1/checkstyle-6.1.1.jar
[ERROR] urls[46] = file:/C:/Users/CRK/.m2/repository/antlr/antlr/2.7.7/antlr-2.7.7.jar
[ERROR] urls[47] = file:/C:/Users/CRK/.m2/repository/org/antlr/antlr4-runtime/4.3/antlr4-runtime-4.3.jar
[ERROR] urls[48] = file:/C:/Users/CRK/.m2/repository/org/abego/treelayout/org.abego.treelayout.core/1.0.1/org.abego.treelayout.core-1.0.1.jar
[ERROR] urls[49] = file:/C:/Users/CRK/.m2/repository/org/antlr/antlr4-annotations/4.3/antlr4-annotations-4.3.jar
[ERROR] urls[50] = file:/C:/Users/CRK/.m2/repository/commons-beanutils/commons-beanutils-core/1.8.3/commons-beanutils-core-1.8.3.jar
[ERROR] urls[51] = file:/C:/Users/CRK/.m2/repository/com/google/guava/guava/18.0/guava-18.0.jar
[ERROR] urls[52] = file:/C:/Users/CRK/.m2/repository/org/apache/velocity/velocity/1.5/velocity-1.5.jar
[ERROR] urls[53] = file:/C:/Users/CRK/.m2/repository/commons-lang/commons-lang/2.1/commons-lang-2.1.jar
[ERROR] urls[54] = file:/C:/Users/CRK/.m2/repository/oro/oro/2.0.8/oro-2.0.8.jar
[ERROR] urls[55] = file:/C:/Users/CRK/.m2/repository/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------
[ERROR] -> [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/PluginContainerException

A clean installation of maven (without maven-color) works just fine (I’ve double checked).

PS: Both logback and log4j2 fail.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jcgaycommented, May 3, 2015

There is an incompatibility between maven-checkstyle-plugin jcl-over-slf4j (v1.5.6) and SLF4J (Maven uses v1.7.5) implementation relying on SLF4JLocationAwareLog Log. This is the case for Logback and Log4J2 but not for SimpleLogger (used by default by Maven, slf4j-simple)…

It can be fixed by overriding maven-checkstyle-plugin dependencies:

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

I haven’t try to downgrade Logback to use the latest version compatible with SLF4J v1.5.x (v0.9.20) but it will probably fail too somewhere as Maven uses SLF4J v1.7.x (The binary incompatibility comes from v1.6.0).

It seems that the problem will appears with other plugins too, as the jcl-over-slf4j dependency comes from maven-core v2.2.1 😦

[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ maven-checkstyle-plugin ---
[INFO] org.apache.maven.plugins:maven-checkstyle-plugin:maven-plugin:2.15
[INFO] +- org.apache.maven:maven-artifact:jar:2.2.1:compile
[INFO] +- org.apache.maven:maven-core:jar:2.2.1:compile
[INFO] |  +- org.apache.maven:maven-settings:jar:2.2.1:compile
[INFO] |  +- org.apache.maven.wagon:wagon-file:jar:1.0-beta-6:runtime
[INFO] |  +- org.apache.maven:maven-plugin-parameter-documenter:jar:2.2.1:compile
[INFO] |  +- org.apache.maven.wagon:wagon-http-lightweight:jar:1.0-beta-6:compile
[INFO] |  |  \- org.apache.maven.wagon:wagon-http-shared:jar:1.0-beta-6:compile
[INFO] |  |     +- nekohtml:xercesMinimal:jar:1.9.6.2:compile
[INFO] |  |     \- nekohtml:nekohtml:jar:1.9.6.2:compile
[INFO] |  +- org.apache.maven.wagon:wagon-http:jar:1.0-beta-6:compile
[INFO] |  +- org.apache.maven.wagon:wagon-webdav-jackrabbit:jar:1.0-beta-6:runtime
[INFO] |  |  +- org.apache.jackrabbit:jackrabbit-webdav:jar:1.5.0:runtime
[INFO] |  |  |  +- org.apache.jackrabbit:jackrabbit-jcr-commons:jar:1.5.0:runtime
[INFO] |  |  |  \- commons-httpclient:commons-httpclient:jar:3.0:runtime
[INFO] |  |  \- org.slf4j:slf4j-nop:jar:1.5.3:runtime
[INFO] |  +- org.slf4j:slf4j-jdk14:jar:1.5.6:runtime
[INFO] |  +- org.slf4j:jcl-over-slf4j:jar:1.5.6:runtime
0reactions
jcgaycommented, Jan 29, 2017

It should be fixed in maven-checkstyle-plugin future release v3.0.0: https://issues.apache.org/jira/browse/MCHECKSTYLE-335

Overriding dependencies is also not mandatory anymore with maven-color v2.0.0 (with Gossip implementation): https://github.com/jcgay/maven-color/wiki/Installation#gossip-beta

Read more comments on GitHub >

github_iconTop Results From Across the Web

Apache Maven Checkstyle Plugin – Using a Suppressions Filter
Checkstyle allows the definition of a list of files and their line ranges that should be suppressed from reporting any violations (known as ......
Read more >
Apache Maven Checkstyle Plugin – Introduction
Apache Maven Checkstyle Plugin. The Checkstyle Plugin generates a report regarding the code style used by the developers.
Read more >
Apache Maven Checkstyle Plugin – Frequently Asked Questions
The checkstyle:check goal is an ordinary goal that reports violations to the console and/or fails the build when there are violations.
Read more >
checkstyle:check - Apache Maven
If null , the Checkstyle plugin will display violations on stdout. Otherwise, a text file will be created with the violations. <violationIgnore> ...
Read more >
Apache Maven Checkstyle Plugin – Usage
To generate the Checkstyle report as part of the Project Reports, add the Checkstyle Plugin in the <reporting> section of your pom.xml ....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found