[ 
https://issues.apache.org/jira/browse/MCHECKSTYLE-309?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Michael Osipov closed MCHECKSTYLE-309.
--------------------------------------
    Resolution: Incomplete

> Upgrade SLF4J dependency version
> --------------------------------
>
>                 Key: MCHECKSTYLE-309
>                 URL: https://issues.apache.org/jira/browse/MCHECKSTYLE-309
>             Project: Maven Checkstyle Plugin
>          Issue Type: Bug
>            Reporter: Konstantin Pokrovsky
>            Priority: Minor
>              Labels: close-pending
>
> Checkstyle has dependencies on old SLF4J versions: slf4j-jdk14-1.5.6 and 
> jcl-over-slf4j-1.5.6. Maven 3.3.3 provide SLF4J 1.7.5 in its libs. By default 
> maven use simple provider for slf4j and it is backward compatible to API 
> 1.5.6. But when I change the provier to logback API compatibility breaks:
> {noformat}
> [ERROR] Failed to execute goal 
> org.apache.maven.plugins:maven-checkstyle-plugin:2.16:check (default) on 
> project rt: Execution default 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
> [ERROR] -----------------------------------------------------
> [ERROR] realm =    
> plugin>org.apache.maven.plugins:maven-checkstyle-plugin:2.16
> [ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
> [ERROR] urls[0] = 
> file:/C:/Users/kpokrovsky/.m2/repository/org/apache/maven/plugins/maven-checkstyle-plugin/2.16/maven-checkstyle-plugin-2.16.jar
> [ERROR] urls[1] = 
> file:/C:/Users/kpokrovsky/.m2/repository/org/slf4j/slf4j-jdk14/1.5.6/slf4j-jdk14-1.5.6.jar
> [ERROR] urls[2] = 
> file:/C:/Users/kpokrovsky/.m2/repository/org/slf4j/jcl-over-slf4j/1.5.6/jcl-over-slf4j-1.5.6.jar
> [ERROR] urls[3] = 
> file:/C:/Users/kpokrovsky/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar
> {noformat}
> Please refer to http://www.slf4j.org/faq.html#compatibility - while API is 
> backward compatible, bindings are not. So checkstyle has to keep its SLF4J 
> versions in sync with maven's SLF4J providers.
> For now problem can be fixed by overriding plugin's dependencies:
> {noformat}
> <plugin>
>   <groupId>org.apache.maven.plugins</groupId>
>   <artifactId>maven-checkstyle-plugin</artifactId>
>   <version>2.16</version>
>   <dependencies>
>     <dependency>
>       <groupId>org.slf4j</groupId>
>       <artifactId>slf4j-jdk14</artifactId>
>       <version>1.7.5</version>
>     </dependency>
>     <dependency>
>       <groupId>org.slf4j</groupId>
>       <artifactId>jcl-over-slf4j</artifactId>
>       <version>1.7.5</version>
>     </dependency>
>   </dependencies>
> </plugin>
> {noformat}
> BTW, for some reason the issue does not appear on maven 3.2.3.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to