Skip to content

log4j in the classpath #753

Closed
Closed

Description

@dbyron0

Not a problem with version 1.7.2, but 1.7.3 and 1.8.0 bring in org.rnorth:tcp-unix-socket-proxy:1.0.2 which indirectly drags in log4j. Here's how (via $ gradle dependencies)

     +--- org.rnorth:tcp-unix-socket-proxy:1.0.2
     |    +--- com.kohlschutter.junixsocket:junixsocket-native-common:2.0.4
     |    |    +--- com.kohlschutter.junixsocket:junixsocket-common:2.0.4
     |    |    |    \--- log4j:log4j:1.2.17
     |    |    +--- org.scijava:native-lib-loader:2.0.2
     |    |    \--- log4j:log4j:1.2.17
     |    +--- com.kohlschutter.junixsocket:junixsocket-common:2.0.4 (*)

junixsocket has already fixed the problem here, but I'm pretty sure no version 2.0.5 has been released. I asked awhile ago, but no dice.

This creates a classpath conflict for me because slf4j (really log4j-over-slf4j) and log4j both contain e.g. org/apache/log4j/Appender.class.

I can exclude log4j myself but here maybe might be better because we use slf4j here.

Activity

  1. rnorth commented on Jun 15, 2018

    @rnorth
    Member

    Hmm, I went to exclude this and saw that there's already an exclusion... 🤔

        compile ('org.rnorth:tcp-unix-socket-proxy:1.0.2') {
            exclude(group: "log4j", module: "log4j")
        }
    

    (in core/build.gradle)

    Will investigate...

  2. kiview commented on Jun 22, 2018

    @kiview
    Member

    When I'm running ./gradlew :testcontainers:dependencies everything looks fine btw.:

    +--- org.rnorth:tcp-unix-socket-proxy:1.0.2
    |    +--- com.kohlschutter.junixsocket:junixsocket-native-common:2.0.4
    |    |    +--- com.kohlschutter.junixsocket:junixsocket-common:2.0.4
    |    |    \--- org.scijava:native-lib-loader:2.0.2
    |    +--- com.kohlschutter.junixsocket:junixsocket-common:2.0.4
    |    \--- org.slf4j:slf4j-api:1.7.21 -> 1.7.25
    
  3. dbyron0 commented on Jun 22, 2018

    @dbyron0
    ContributorAuthor

    I think the struggle is that the published pom (e.g. http://central.maven.org/maven2/org/testcontainers/testcontainers/1.8.0/testcontainers-1.8.0.pom) doesn't exclude it. I see the same thing in ~/.m2/repositories when I run: $ ./gradlew testcontainers:publishToMavenLocal (though the version there shows up as unspecified...different issue).

    I think the struggle is in the custom way the pom gets built....here. This doesn't take into account the exclusions. Changing to a configuration-wide exclusion:

    configurations {
        compile.exclude group: 'log4j', module: 'log4j'
    }
    

    didn't help.

    I took a crack at the more vanilla way of building a pom (by specifying from components.java as the docs say, and commenting out the code that adds dependencies to the xml directly), and the exclusions show up in the pom, but it's messy.

  4. bsideup commented on Jun 22, 2018

    @bsideup
    Member
  5. dbyron0 commented on Jun 22, 2018

    @dbyron0
    ContributorAuthor

    There's been a lot of activity on the gradle side around publishing...It's likely worth upgrading to 4.8.1 at least for https://docs.gradle.org/4.8/release-notes.html#customizing-the-generated-pom, though I don't see a silver bullet for this issue.

  6. rnorth commented on Jul 12, 2018

    @rnorth
    Member

    Released in 1.8.1! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions