Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-5961

Maven possibly not aware of log4j2

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.3.9
    • Fix Version/s: 3.5.0-alpha-1, 3.5.0
    • Component/s: Logging
    • Labels:
      None

      Description

      Using a fresh install of maven 3.3.9 I followed the steps at https://garygregory.wordpress.com/2015/03/23/watch-maven-in-color to add color highlighting to my output. Everything works as expected, however on all usages I would get the warning:

      [WARN] The SLF4J binding actually used is not supported by Maven: org.apache.logging.slf4j.Log4jLoggerFactory
      [WARN] Maven supported bindings are:
      [WARN] (from jar:file:/opt/apache-maven-3.3.9/lib/maven-embedder-3.3.9.jar!/META-INF/maven/slf4j-configuration.properties)
      - ch.qos.logback.classic.LoggerContext
      - org.slf4j.helpers.Log4jLoggerFactory
      - org.slf4j.impl.SimpleLoggerFactory
      

      This looks pretty harmless, and I was able to suppress it by manually adding the line

      org.apache.logging.slf4j.Log4jLoggerFactory org.apache.maven.cli.logging.impl.Log4j2Configuration
      

      to /META-INF/maven/slf4j-configuration.properties in maven-embedder-3.3.9.jar.

      I'm not sure that this is a "correct" solution, and I'm not even confident I could explain what effect it has, hence not posting a patch, but somebody with more knowledge might be able to triage this better. Or offer an "official" way to do colorized output.

        Issue Links

          Activity

          Show
          michael-o Michael Osipov added a comment - - edited I think this is a duplicate of MNG-3507 fixed with https://git-wip-us.apache.org/repos/asf?p=maven.git;a=commit;h=202f757af3aba6e1b96631de025e0ba692098009 .
          Hide
          aheritier Arnaud HERITIER added a comment -

          Yes it is exactly what I just fixed in master (thus for 3.3.10) with the commit mentionned by Michael Osipov
          This bug was a subtask to complete MNG-3507 with LOG4J (Issue which may not be solved soon)

          Show
          aheritier Arnaud HERITIER added a comment - Yes it is exactly what I just fixed in master (thus for 3.3.10) with the commit mentionned by Michael Osipov This bug was a subtask to complete MNG-3507 with LOG4J (Issue which may not be solved soon)
          Hide
          michael-o Michael Osipov added a comment -

          I have changed the fix version to 3.4.0 because master is already on 3.4.0. 3.3.10 is unlikely.

          Show
          michael-o Michael Osipov added a comment - I have changed the fix version to 3.4.0 because master is already on 3.4.0. 3.3.10 is unlikely.
          Hide
          aheritier Arnaud HERITIER added a comment -

          ok thanks Michael Osipov I didn't notice it

          Show
          aheritier Arnaud HERITIER added a comment - ok thanks Michael Osipov I didn't notice it
          Hide
          stephenc Stephen Connolly added a comment -

          Maven 3.4.0 has been dropped. See this thread for more details.

          This issue will need to be re-scheduled for a Maven release in the (hopefully near) future.

          Show
          stephenc Stephen Connolly added a comment - Maven 3.4.0 has been dropped. See this thread for more details. This issue will need to be re-scheduled for a Maven release in the (hopefully near) future.
          Hide
          aheritier Arnaud HERITIER added a comment -

          This fix is trivial Stephen Connolly we could re-apply it with no risk

          Show
          aheritier Arnaud HERITIER added a comment - This fix is trivial Stephen Connolly we could re-apply it with no risk
          Hide
          michael-o Michael Osipov added a comment -

          Please have a look at the file now. It is fixed?

          Show
          michael-o Michael Osipov added a comment - Please have a look at the file now. It is fixed?
          Hide
          githubbot ASF GitHub Bot added a comment -

          GitHub user aheritier opened a pull request:

          https://github.com/apache/maven/pull/104

          MNG-5961 Fix the SLF4J logger factory implementation used for LOG4J2

          This is the fix I did in https://git-wip-us.apache.org/repos/asf?p=maven.git;a=blobdiff;f=maven-embedder/src/main/resources/META-INF/maven/slf4j-configuration.properties;h=cd01f9e6bb29cf31371e0e6df04d095430d3ea9b;hp=87418363b1812e85d6a41a63df4486d07227e1d5;hb=202f757af3aba6e1b96631de025e0ba692098009;hpb=5a3332ca347628605bec7d3e9f9309081aaba46c

          You can merge this pull request into a Git repository by running:

          $ git pull https://github.com/aheritier/maven patch-1

          Alternatively you can review and apply these changes as the patch at:

          https://github.com/apache/maven/pull/104.patch

          To close this pull request, make a commit to your master/trunk branch
          with (at least) the following in the commit message:

          This closes #104


          commit 0055ac0b4b572fa0e8bf699327ea45263ce40e81
          Author: Arnaud Heritier <aheritier@apache.org>
          Date: 2017-01-31T09:26:28Z

          MNG-5961 Fix the SLF4J logger factory implementation used for LOG4J2


          Show
          githubbot ASF GitHub Bot added a comment - GitHub user aheritier opened a pull request: https://github.com/apache/maven/pull/104 MNG-5961 Fix the SLF4J logger factory implementation used for LOG4J2 This is the fix I did in https://git-wip-us.apache.org/repos/asf?p=maven.git;a=blobdiff;f=maven-embedder/src/main/resources/META-INF/maven/slf4j-configuration.properties;h=cd01f9e6bb29cf31371e0e6df04d095430d3ea9b;hp=87418363b1812e85d6a41a63df4486d07227e1d5;hb=202f757af3aba6e1b96631de025e0ba692098009;hpb=5a3332ca347628605bec7d3e9f9309081aaba46c You can merge this pull request into a Git repository by running: $ git pull https://github.com/aheritier/maven patch-1 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/maven/pull/104.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #104 commit 0055ac0b4b572fa0e8bf699327ea45263ce40e81 Author: Arnaud Heritier <aheritier@apache.org> Date: 2017-01-31T09:26:28Z MNG-5961 Fix the SLF4J logger factory implementation used for LOG4J2
          Hide
          aheritier Arnaud HERITIER added a comment -

          I just did a PR to fix it
          https://github.com/apache/maven/pull/104

          Show
          aheritier Arnaud HERITIER added a comment - I just did a PR to fix it https://github.com/apache/maven/pull/104
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user aheritier commented on the issue:

          https://github.com/apache/maven/pull/104

          cc @michael-o @stephenc
          https://issues.apache.org/jira/browse/MNG-5961

          Show
          githubbot ASF GitHub Bot added a comment - Github user aheritier commented on the issue: https://github.com/apache/maven/pull/104 cc @michael-o @stephenc https://issues.apache.org/jira/browse/MNG-5961
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user aheritier commented on the issue:

          https://github.com/apache/maven/pull/104

          I think @stephenc will tell me to push a branch on ASF side

          Show
          githubbot ASF GitHub Bot added a comment - Github user aheritier commented on the issue: https://github.com/apache/maven/pull/104 I think @stephenc will tell me to push a branch on ASF side
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user michael-o commented on the issue:

          https://github.com/apache/maven/pull/104

          I am fine with this PR. You have to raise the issue on the dev mailing list to have at least someone who seconds it. If someone does, after your branch passes all tests, go ahead and merge into master.

          Show
          githubbot ASF GitHub Bot added a comment - Github user michael-o commented on the issue: https://github.com/apache/maven/pull/104 I am fine with this PR. You have to raise the issue on the dev mailing list to have at least someone who seconds it. If someone does, after your branch passes all tests, go ahead and merge into master.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user aheritier commented on the issue:

          https://github.com/apache/maven/pull/104

          @michael-o we don't have a CI validation here, thus I have to open a real branch on ASF side. Right ?

          Show
          githubbot ASF GitHub Bot added a comment - Github user aheritier commented on the issue: https://github.com/apache/maven/pull/104 @michael-o we don't have a CI validation here, thus I have to open a real branch on ASF side. Right ?
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user michael-o commented on the issue:

          https://github.com/apache/maven/pull/104

          Do this:

          git checkout master
          git checkout -b MNG-5961
          git cherry-pick <your-sha1>
          git push

          Wait for the Jenkins build to finish, get approval

          git checkout master
          git merge MNG-5961

          Delete branch locally and remote.

          Show
          githubbot ASF GitHub Bot added a comment - Github user michael-o commented on the issue: https://github.com/apache/maven/pull/104 Do this: git checkout master git checkout -b MNG-5961 git cherry-pick <your-sha1> git push Wait for the Jenkins build to finish, get approval git checkout master git merge MNG-5961 Delete branch locally and remote.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user aheritier commented on the issue:

          https://github.com/apache/maven/pull/104

          Cool @michael-o it is exactly what I did
          the build is in progress
          https://builds.apache.org/view/Maven/job/maven-3.x-jenkinsfile/job/MNG-5961/

          Show
          githubbot ASF GitHub Bot added a comment - Github user aheritier commented on the issue: https://github.com/apache/maven/pull/104 Cool @michael-o it is exactly what I did the build is in progress https://builds.apache.org/view/Maven/job/maven-3.x-jenkinsfile/job/MNG-5961/
          Hide
          aheritier Arnaud HERITIER added a comment -

          About the fact to replace org.slf4j.helpers.Log4jLoggerFactory by org.apache.logging.slf4j.Log4jLoggerFactory and not the addition of a new entry it is because the old one was wrong. org.slf4j.helpers.Log4jLoggerFactory is for LOG4J 1.x not 2.x https://www.slf4j.org/xref/org/slf4j/impl/Log4jLoggerFactory.html

          Show
          aheritier Arnaud HERITIER added a comment - About the fact to replace org.slf4j.helpers.Log4jLoggerFactory by org.apache.logging.slf4j.Log4jLoggerFactory and not the addition of a new entry it is because the old one was wrong. org.slf4j.helpers.Log4jLoggerFactory is for LOG4J 1.x not 2.x https://www.slf4j.org/xref/org/slf4j/impl/Log4jLoggerFactory.html
          Hide
          michael-o Michael Osipov added a comment -

          If you think this is wrong, please create a new issue.

          Show
          michael-o Michael Osipov added a comment - If you think this is wrong, please create a new issue.
          Hide
          aheritier Arnaud HERITIER added a comment -

          no it's good Michael Osipov it was just to explain why I replaced the entry and I didn't add a new one (I had the question, thus I prefer to keep a public trace of it)

          Show
          aheritier Arnaud HERITIER added a comment - no it's good Michael Osipov it was just to explain why I replaced the entry and I didn't add a new one (I had the question, thus I prefer to keep a public trace of it)
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user stephenc commented on the issue:

          https://github.com/apache/maven/pull/104

          > we don't have a CI validation here

          Yep waiting to get SCM API 2.0.x back into the uc and then pester infra to upgrade

          Show
          githubbot ASF GitHub Bot added a comment - Github user stephenc commented on the issue: https://github.com/apache/maven/pull/104 > we don't have a CI validation here Yep waiting to get SCM API 2.0.x back into the uc and then pester infra to upgrade
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user aheritier closed the pull request at:

          https://github.com/apache/maven/pull/104

          Show
          githubbot ASF GitHub Bot added a comment - Github user aheritier closed the pull request at: https://github.com/apache/maven/pull/104
          Hide
          aheritier Arnaud HERITIER added a comment -

          Fixed in 3.5.0

          Show
          aheritier Arnaud HERITIER added a comment - Fixed in 3.5.0
          Hide
          hudson Hudson added a comment -

          FAILURE: Integrated in Jenkins build maven-3.x #1539 (See https://builds.apache.org/job/maven-3.x/1539/)
          MNG-5961 Fix the SLF4J logger factory implementation used for LOG4J2 (aheritier: http://git-wip-us.apache.org/repos/asf/?p=maven.git&a=commit&h=23ceca36e7c980cc8d8bdc16d64ede98189079aa)

          • (edit) maven-embedder/src/main/resources/META-INF/maven/slf4j-configuration.properties
          Show
          hudson Hudson added a comment - FAILURE: Integrated in Jenkins build maven-3.x #1539 (See https://builds.apache.org/job/maven-3.x/1539/ ) MNG-5961 Fix the SLF4J logger factory implementation used for LOG4J2 (aheritier: http://git-wip-us.apache.org/repos/asf/?p=maven.git&a=commit&h=23ceca36e7c980cc8d8bdc16d64ede98189079aa ) (edit) maven-embedder/src/main/resources/META-INF/maven/slf4j-configuration.properties

            People

            • Assignee:
              aheritier Arnaud HERITIER
              Reporter:
              mdrob Mike Drob
            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development