Log4j 2
  1. Log4j 2
  2. LOG4J2-736

Importing log4j bom changes scope of commons-code to "test"

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0.1
    • Component/s: Core
    • Labels:
      None
    • Environment:

      Description

      By importing log4j bom, as recommended on http://logging.apache.org/log4j/2.x/maven-artifacts.html#Bill_of_Material, according to my tests, at the moment commons-codec:commons-codec:jar:1.9 is affected, with its scope automatically changed to "test" when not explicitly specified (e.g. as "compile"). While the import of bom is removed, implicitly declared scope of commons-code is "compile" as expected.

      1. pom.xml
        1 kB
        Jerome Jia

        Activity

        Hide
        Jerome Jia added a comment - - edited

        A very simple pom to validate the problem. Check the output of mvn dependency:tree .

        I understand merely running something like dependency:tree or dependency:list may seem quite reckless but it accords with my actual problem running other goals/phases just as expected.

        Moreover, importing the bom only affects commons-codec for me, all my other dependencies, e.g. various Spring artifacts, bouncycastle for jdk1.5 and above, javaee 7 API, either within or outside "dependencyManagement", all resolve correctly. Feel free to also test these out with the simple pom, as I'm not quite sure if this is an actual bug or some usage problem of mine.

        Show
        Jerome Jia added a comment - - edited A very simple pom to validate the problem. Check the output of mvn dependency:tree . I understand merely running something like dependency:tree or dependency:list may seem quite reckless but it accords with my actual problem running other goals/phases just as expected. Moreover, importing the bom only affects commons-codec for me, all my other dependencies, e.g. various Spring artifacts, bouncycastle for jdk1.5 and above, javaee 7 API, either within or outside "dependencyManagement", all resolve correctly. Feel free to also test these out with the simple pom, as I'm not quite sure if this is an actual bug or some usage problem of mine.
        Hide
        Gary Gregory added a comment -

        Log4j only uses commons-codec for unit tests.

        Show
        Gary Gregory added a comment - Log4j only uses commons-codec for unit tests.
        Hide
        Matt Sicker added a comment -

        Fixed in trunk. To test this, change the version of log4j-bom to 2.1-SNAPSHOT and run mvn clean package with it. Please verify and close.

        Show
        Matt Sicker added a comment - Fixed in trunk. To test this, change the version of log4j-bom to 2.1-SNAPSHOT and run mvn clean package with it. Please verify and close.
        Hide
        Jerome Jia added a comment -

        Verified. Thanks.

        Show
        Jerome Jia added a comment - Verified. Thanks.

          People

          • Assignee:
            Matt Sicker
            Reporter:
            Jerome Jia
          • Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development