0

I am using the Maven Build step and Maven tells me it has succeeded when I queue the build, however I still see errors in the issues section.

In the control section I do not have checked the option to Continue on Error.

Here are the build issues I am seeing:

  1. SLF4J: Class path contains multiple SLF4J bindings.
  2. SLF4J: Found binding in [jar:file:/C:/Windows/ServiceProfiles/NetworkService/.m2/repository/ch/qos/logback/logback-classic/1.1.3/logback-classic-1.1.3.jar!/org/slf4j/impl/StaticLoggerBinder.class]
  3. SLF4J: Found binding in [jar:file:/C:/Windows/ServiceProfiles/NetworkService/.m2/repository/org/apache/logging/log4j/log4j-slf4j-impl/2.4.1/log4j-slf4j-impl-2.4.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
  4. SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
  5. SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]

Per the documentation this is just a warning, however I would like it to fail on such warnings, how do I do that?

javapapo
  • 1,342
  • 14
  • 26
aeatonDev
  • 767
  • 1
  • 6
  • 13
  • 1
    You can try the second solution here http://stackoverflow.com/questions/9192613/how-do-i-get-a-java-maven-build-to-fail-for-compiler-warnings or use a build automation tool like jenkins which has this option – Revive Feb 12 '16 at 16:19
  • Thanks for that note, but my problem is that these show as errors in the build log, but the build doesn't stop on them. The link there in the example goes on to explain that it is just a warning. I just want to ensure that if the build has an error, that it will break on it. Not necessarily break on all true warnings. Least not until the process has matured more. – aeatonDev Feb 12 '16 at 16:54
  • The question is do these warnings actually cause Maven to fail? We see cases where build scripts will output errors or warnings but not actually cause the build engine to fail. – Chris Patterson Feb 17 '16 at 21:43

1 Answers1

1

Hi this is just a warning that notifies you that there are multiple jars in your configured classpath - that have SL4J binding implementations (to put it simply). Please look up the official documentation here.

You can try and modify the maven compiler plugin configuration to fail on warnings

<plugins>
    <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.3</version>
        <configuration>
            <source>1.8</source>
            <target>1.8</target>
            <showWarnings>true</showWarnings>
            <compilerArgs>
                <arg>-Xlint:all</arg>
                <arg>-Werror</arg>
            </compilerArgs>
        </configuration>
    </plugin>
</plugins>

Example taken from this question

Hope that helps

Community
  • 1
  • 1
javapapo
  • 1,342
  • 14
  • 26
  • Giving you an up vote, but not the solve. I like the idea of having warnings show up as errors, but it picks up all warnings and I don't want that exactly. My issue is that the build notes show these as errors, but don't break on them. The documentation for the error say it is a warning however. – aeatonDev Feb 12 '16 at 16:52
  • I thought of the same thing, but they aren't true warnings. 2016-02-12T17:14:45.2391472Z ##[error]SLF4J: ... They are errors per Maven, but not breaking ones. – aeatonDev Feb 12 '16 at 17:18