Skip to content

commons-logging:commons-logging should not be a transitive dependency #1989

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wilkinsona opened this issue Nov 12, 2021 · 14 comments · Fixed by #1993
Closed

commons-logging:commons-logging should not be a transitive dependency #1989

wilkinsona opened this issue Nov 12, 2021 · 14 comments · Fixed by #1993
Labels
status: feedback-provided Feedback has been provided status: waiting-for-triage An issue we've not yet triaged

Comments

@wilkinsona
Copy link
Member

Spring projects should use Spring Framework's spring-jcl module (a dependency of spring-core) in place of commons-logging:commons-logging, however spring-data-elasticsearch pulls in commons-logging:commons-logging transitively. Can it please be excluded so that users don't end up with two different set of Commons Logging classes on their classpath?

@wilkinsona wilkinsona changed the title commons-logging:commons-logging is a transitive dependency commons-logging:commons-logging should not be a transitive dependency Nov 12, 2021
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Nov 12, 2021
@sothawo
Copy link
Collaborator

sothawo commented Nov 12, 2021

I don't see where commons-logging is pulled in. The dependency tree from the current main branch:

 ./mvnw dependency:tree                                                                                                                                                  130 ↵
[INFO] Scanning for projects...
[INFO]
[INFO] ---------< org.springframework.data:spring-data-elasticsearch >---------
[INFO] Building Spring Data Elasticsearch 4.4.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:3.1.2:tree (default-cli) @ spring-data-elasticsearch ---
[INFO] org.springframework.data:spring-data-elasticsearch:jar:4.4.0-SNAPSHOT
[INFO] +- org.springframework:spring-context:jar:5.3.13:compile
[INFO] |  +- org.springframework:spring-aop:jar:5.3.13:compile
[INFO] |  +- org.springframework:spring-beans:jar:5.3.13:compile
[INFO] |  +- org.springframework:spring-core:jar:5.3.13:compile
[INFO] |  |  \- org.springframework:spring-jcl:jar:5.3.13:compile
[INFO] |  \- org.springframework:spring-expression:jar:5.3.13:compile
[INFO] +- org.springframework:spring-tx:jar:5.3.13:compile
[INFO] +- org.springframework.data:spring-data-commons:jar:2.7.0-SNAPSHOT:compile
[INFO] +- org.springframework:spring-webflux:jar:5.3.13:compile (optional)
[INFO] |  +- org.springframework:spring-web:jar:5.3.13:compile (optional)
[INFO] |  \- io.projectreactor:reactor-core:jar:3.4.12:compile
[INFO] |     \- org.reactivestreams:reactive-streams:jar:1.0.3:compile
[INFO] +- io.projectreactor.netty:reactor-netty-http:jar:1.0.13:compile (optional)
[INFO] |  +- io.netty:netty-codec-http:jar:4.1.65.Final:compile
[INFO] |  +- io.netty:netty-codec-http2:jar:4.1.65.Final:compile (optional)
[INFO] |  +- io.netty:netty-resolver-dns:jar:4.1.65.Final:compile (optional)
[INFO] |  |  \- io.netty:netty-codec-dns:jar:4.1.65.Final:compile (optional)
[INFO] |  +- io.netty:netty-resolver-dns-native-macos:jar:osx-x86_64:4.1.65.Final:compile (optional)
[INFO] |  |  \- io.netty:netty-transport-native-unix-common:jar:4.1.65.Final:compile (optional)
[INFO] |  +- io.netty:netty-transport-native-epoll:jar:linux-x86_64:4.1.65.Final:compile (optional)
[INFO] |  \- io.projectreactor.netty:reactor-netty-core:jar:1.0.13:compile (optional)
[INFO] |     \- io.netty:netty-handler-proxy:jar:4.1.65.Final:compile (optional)
[INFO] |        \- io.netty:netty-codec-socks:jar:4.1.65.Final:compile (optional)
[INFO] +- io.projectreactor:reactor-test:jar:3.4.12:test
[INFO] +- org.elasticsearch.client:transport:jar:7.15.2:compile
[INFO] |  +- org.elasticsearch:elasticsearch:jar:7.15.2:compile
[INFO] |  |  +- org.elasticsearch:elasticsearch-core:jar:7.15.2:compile
[INFO] |  |  +- org.elasticsearch:elasticsearch-secure-sm:jar:7.15.2:compile
[INFO] |  |  +- org.elasticsearch:elasticsearch-x-content:jar:7.15.2:compile
[INFO] |  |  |  +- org.yaml:snakeyaml:jar:1.26:compile
[INFO] |  |  |  +- com.fasterxml.jackson.dataformat:jackson-dataformat-smile:jar:2.13.0:compile
[INFO] |  |  |  +- com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:jar:2.13.0:compile
[INFO] |  |  |  \- com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:jar:2.13.0:compile
[INFO] |  |  +- org.elasticsearch:elasticsearch-geo:jar:7.15.2:compile
[INFO] |  |  +- org.apache.lucene:lucene-core:jar:8.9.0:compile
[INFO] |  |  +- org.apache.lucene:lucene-analyzers-common:jar:8.9.0:compile
[INFO] |  |  +- org.apache.lucene:lucene-backward-codecs:jar:8.9.0:compile
[INFO] |  |  +- org.apache.lucene:lucene-grouping:jar:8.9.0:compile
[INFO] |  |  +- org.apache.lucene:lucene-highlighter:jar:8.9.0:compile
[INFO] |  |  +- org.apache.lucene:lucene-join:jar:8.9.0:compile
[INFO] |  |  +- org.apache.lucene:lucene-memory:jar:8.9.0:compile
[INFO] |  |  +- org.apache.lucene:lucene-misc:jar:8.9.0:compile
[INFO] |  |  +- org.apache.lucene:lucene-queries:jar:8.9.0:compile
[INFO] |  |  +- org.apache.lucene:lucene-queryparser:jar:8.9.0:compile
[INFO] |  |  +- org.apache.lucene:lucene-sandbox:jar:8.9.0:compile
[INFO] |  |  +- org.apache.lucene:lucene-spatial-extras:jar:8.9.0:compile
[INFO] |  |  +- org.apache.lucene:lucene-spatial3d:jar:8.9.0:compile
[INFO] |  |  +- org.apache.lucene:lucene-suggest:jar:8.9.0:compile
[INFO] |  |  +- org.elasticsearch:elasticsearch-cli:jar:7.15.2:compile
[INFO] |  |  +- com.carrotsearch:hppc:jar:0.8.1:compile
[INFO] |  |  +- org.lz4:lz4-java:jar:1.8.0:compile
[INFO] |  |  +- joda-time:joda-time:jar:2.10.10:compile
[INFO] |  |  +- com.tdunning:t-digest:jar:3.2:compile
[INFO] |  |  +- org.hdrhistogram:HdrHistogram:jar:2.1.9:compile
[INFO] |  |  +- org.elasticsearch:jna:jar:5.7.0-1:compile
[INFO] |  |  \- org.elasticsearch:elasticsearch-plugin-classloader:jar:7.15.2:runtime
[INFO] |  +- org.elasticsearch.plugin:reindex-client:jar:7.15.2:compile
[INFO] |  |  \- org.elasticsearch:elasticsearch-ssl-config:jar:7.15.2:compile
[INFO] |  +- org.elasticsearch.plugin:lang-mustache-client:jar:7.15.2:compile
[INFO] |  |  \- com.github.spullara.mustache.java:compiler:jar:0.9.6:compile
[INFO] |  +- org.elasticsearch.plugin:percolator-client:jar:7.15.2:compile
[INFO] |  +- org.elasticsearch.plugin:parent-join-client:jar:7.15.2:compile
[INFO] |  \- org.elasticsearch.plugin:rank-eval-client:jar:7.15.2:compile
[INFO] +- org.elasticsearch.plugin:transport-netty4-client:jar:7.15.2:compile
[INFO] |  +- io.netty:netty-buffer:jar:4.1.65.Final:compile
[INFO] |  +- io.netty:netty-codec:jar:4.1.65.Final:compile
[INFO] |  +- io.netty:netty-common:jar:4.1.65.Final:compile
[INFO] |  +- io.netty:netty-handler:jar:4.1.65.Final:compile
[INFO] |  +- io.netty:netty-resolver:jar:4.1.65.Final:compile
[INFO] |  \- io.netty:netty-transport:jar:4.1.65.Final:compile
[INFO] +- org.elasticsearch.client:elasticsearch-rest-high-level-client:jar:7.15.2:compile
[INFO] |  +- org.elasticsearch.client:elasticsearch-rest-client:jar:7.15.2:compile
[INFO] |  |  +- org.apache.httpcomponents:httpcore:jar:4.4.12:compile
[INFO] |  |  +- org.apache.httpcomponents:httpasyncclient:jar:4.1.4:compile
[INFO] |  |  +- org.apache.httpcomponents:httpcore-nio:jar:4.4.12:compile
[INFO] |  |  \- commons-codec:commons-codec:jar:1.11:compile
[INFO] |  +- org.elasticsearch.plugin:mapper-extras-client:jar:7.15.2:compile
[INFO] |  \- org.elasticsearch.plugin:aggs-matrix-stats-client:jar:7.15.2:compile
[INFO] +- org.slf4j:log4j-over-slf4j:jar:1.7.32:test
[INFO] +- org.apache.logging.log4j:log4j-core:jar:2.14.1:test
[INFO] |  \- org.apache.logging.log4j:log4j-api:jar:2.14.1:compile
[INFO] +- com.fasterxml.jackson.core:jackson-core:jar:2.13.0:compile
[INFO] +- com.fasterxml.jackson.core:jackson-databind:jar:2.13.0:compile
[INFO] |  \- com.fasterxml.jackson.core:jackson-annotations:jar:2.13.0:compile
[INFO] +- org.apache.geronimo.specs:geronimo-jcdi_2.0_spec:jar:1.0.1:test
[INFO] +- javax.interceptor:javax.interceptor-api:jar:1.2.1:test
[INFO] +- javax.enterprise:cdi-api:jar:1.0:provided (optional)
[INFO] |  +- org.jboss.interceptor:jboss-interceptor-api:jar:1.1:provided (optional)
[INFO] |  +- javax.annotation:jsr250-api:jar:1.0:provided (optional)
[INFO] |  \- javax.inject:javax.inject:jar:1:provided (optional)
[INFO] +- javax.annotation:javax.annotation-api:jar:1.3.2:test
[INFO] +- org.apache.openwebbeans:openwebbeans-se:jar:2.0.23:test
[INFO] |  \- org.apache.openwebbeans:openwebbeans-impl:jar:2.0.23:test
[INFO] |     +- org.apache.xbean:xbean-finder-shaded:jar:4.18:test
[INFO] |     +- org.apache.xbean:xbean-asm9-shaded:jar:4.18:test
[INFO] |     |  \- org.apache.xbean:xbean-asm-util:jar:4.18:test
[INFO] |     \- org.apache.openwebbeans:openwebbeans-spi:jar:2.0.23:test
[INFO] +- org.springframework:spring-test:jar:5.3.13:test
[INFO] +- org.apache.logging.log4j:log4j-to-slf4j:jar:2.14.1:test
[INFO] +- io.projectreactor.tools:blockhound-junit-platform:jar:1.0.6.RELEASE:test
[INFO] |  \- io.projectreactor.tools:blockhound:jar:1.0.6.RELEASE:test
[INFO] +- org.projectlombok:lombok:jar:999999:test
[INFO] +- org.skyscreamer:jsonassert:jar:1.5.0:test
[INFO] |  \- com.vaadin.external.google:android-json:jar:0.0.20131108.vaadin1:test
[INFO] +- com.github.tomakehurst:wiremock-jre8:jar:2.26.3:test
[INFO] |  +- org.eclipse.jetty:jetty-server:jar:9.4.20.v20190813:test
[INFO] |  |  +- org.eclipse.jetty:jetty-http:jar:9.4.20.v20190813:test
[INFO] |  |  \- org.eclipse.jetty:jetty-io:jar:9.4.20.v20190813:test
[INFO] |  +- org.eclipse.jetty:jetty-servlet:jar:9.4.20.v20190813:test
[INFO] |  |  \- org.eclipse.jetty:jetty-security:jar:9.4.20.v20190813:test
[INFO] |  +- org.eclipse.jetty:jetty-servlets:jar:9.4.20.v20190813:test
[INFO] |  |  +- org.eclipse.jetty:jetty-continuation:jar:9.4.20.v20190813:test
[INFO] |  |  \- org.eclipse.jetty:jetty-util:jar:9.4.20.v20190813:test
[INFO] |  +- org.eclipse.jetty:jetty-webapp:jar:9.4.20.v20190813:test
[INFO] |  |  \- org.eclipse.jetty:jetty-xml:jar:9.4.20.v20190813:test
[INFO] |  +- com.google.guava:guava:jar:27.0.1-jre:test
[INFO] |  |  +- com.google.guava:failureaccess:jar:1.0.1:test
[INFO] |  |  +- com.google.guava:listenablefuture:jar:9999.0-empty-to-avoid-conflict-with-guava:test
[INFO] |  |  +- com.google.code.findbugs:jsr305:jar:3.0.2:test
[INFO] |  |  +- org.checkerframework:checker-qual:jar:2.5.2:test
[INFO] |  |  +- com.google.errorprone:error_prone_annotations:jar:2.2.0:test
[INFO] |  |  +- com.google.j2objc:j2objc-annotations:jar:1.1:test
[INFO] |  |  \- org.codehaus.mojo:animal-sniffer-annotations:jar:1.17:test
[INFO] |  +- org.apache.httpcomponents:httpclient:jar:4.5.6:compile
[INFO] |  +- org.xmlunit:xmlunit-core:jar:2.6.2:test
[INFO] |  +- org.xmlunit:xmlunit-legacy:jar:2.6.2:test
[INFO] |  +- org.xmlunit:xmlunit-placeholders:jar:2.6.2:test
[INFO] |  +- com.jayway.jsonpath:json-path:jar:2.4.0:test
[INFO] |  |  \- net.minidev:json-smart:jar:2.3:test
[INFO] |  |     \- net.minidev:accessors-smart:jar:1.2:test
[INFO] |  +- net.sf.jopt-simple:jopt-simple:jar:5.0.3:compile
[INFO] |  +- org.apache.commons:commons-lang3:jar:3.7:test
[INFO] |  +- com.github.jknack:handlebars:jar:4.1.2:test
[INFO] |  +- com.github.jknack:handlebars-helpers:jar:4.1.2:test
[INFO] |  +- com.flipkart.zjsonpatch:zjsonpatch:jar:0.4.4:test
[INFO] |  +- commons-fileupload:commons-fileupload:jar:1.4:test
[INFO] |  |  \- commons-io:commons-io:jar:2.2:test
[INFO] |  +- org.eclipse.jetty.http2:http2-server:jar:9.4.20.v20190813:test
[INFO] |  |  \- org.eclipse.jetty.http2:http2-common:jar:9.4.20.v20190813:test
[INFO] |  |     \- org.eclipse.jetty.http2:http2-hpack:jar:9.4.20.v20190813:test
[INFO] |  +- org.eclipse.jetty:jetty-alpn-server:jar:9.4.20.v20190813:test
[INFO] |  +- org.eclipse.jetty:jetty-alpn-conscrypt-server:jar:9.4.20.v20190813:test
[INFO] |  |  \- org.conscrypt:conscrypt-openjdk-uber:jar:2.1.0:test
[INFO] |  +- org.eclipse.jetty:jetty-alpn-conscrypt-client:jar:9.4.20.v20190813:test
[INFO] |  |  \- org.eclipse.jetty:jetty-alpn-client:jar:9.4.20.v20190813:test
[INFO] |  \- net.javacrumbs.json-unit:json-unit-core:jar:2.12.0:test
[INFO] |     +- org.opentest4j:opentest4j:jar:1.1.1:test
[INFO] |     \- org.hamcrest:hamcrest-core:jar:2.1:test
[INFO] |        \- org.hamcrest:hamcrest:jar:2.1:test
[INFO] +- io.specto:hoverfly-java-junit5:jar:0.13.1:test
[INFO] |  \- io.specto:hoverfly-java:jar:0.13.1:test
[INFO] |     +- com.squareup.okhttp3:okhttp:jar:3.12.0:test
[INFO] |     |  \- com.squareup.okio:okio:jar:1.15.0:test
[INFO] |     +- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.13.0:test
[INFO] |     +- com.fasterxml.jackson.dataformat:jackson-dataformat-xml:jar:2.13.0:test
[INFO] |     |  +- org.codehaus.woodstox:stax2-api:jar:4.2.1:test
[INFO] |     |  \- com.fasterxml.woodstox:woodstox-core:jar:6.2.6:test
[INFO] |     \- org.zeroturnaround:zt-exec:jar:1.10:test
[INFO] +- org.apache.xbean:xbean-asm5-shaded:jar:4.5:test
[INFO] +- javax.servlet:javax.servlet-api:jar:3.1.0:test
[INFO] +- org.mockito:mockito-junit-jupiter:jar:3.12.4:test
[INFO] |  \- org.junit.jupiter:junit-jupiter-api:jar:5.8.1:test
[INFO] |     \- org.junit.platform:junit-platform-commons:jar:1.8.1:test
[INFO] +- org.testcontainers:elasticsearch:jar:1.15.3:test
[INFO] |  \- org.testcontainers:testcontainers:jar:1.15.3:test
[INFO] |     +- org.apache.commons:commons-compress:jar:1.20:test
[INFO] |     +- org.rnorth.duct-tape:duct-tape:jar:1.0.8:test
[INFO] |     +- org.rnorth.visible-assertions:visible-assertions:jar:2.1.2:test
[INFO] |     |  \- net.java.dev.jna:jna:jar:5.2.0:test
[INFO] |     +- com.github.docker-java:docker-java-api:jar:3.2.8:test
[INFO] |     \- com.github.docker-java:docker-java-transport-zerodep:jar:3.2.8:test
[INFO] |        \- com.github.docker-java:docker-java-transport:jar:3.2.8:test
[INFO] +- org.junit.jupiter:junit-jupiter:jar:5.8.1:test
[INFO] |  +- org.junit.jupiter:junit-jupiter-params:jar:5.8.1:test
[INFO] |  \- org.junit.jupiter:junit-jupiter-engine:jar:5.8.1:test
[INFO] +- org.junit.vintage:junit-vintage-engine:jar:5.8.1:test
[INFO] |  +- org.junit.platform:junit-platform-engine:jar:1.8.1:test
[INFO] |  +- junit:junit:jar:4.13.2:test
[INFO] |  \- org.apiguardian:apiguardian-api:jar:1.1.2:test
[INFO] +- org.mockito:mockito-core:jar:3.12.4:test
[INFO] |  +- net.bytebuddy:byte-buddy:jar:1.11.13:test
[INFO] |  +- net.bytebuddy:byte-buddy-agent:jar:1.11.13:test
[INFO] |  \- org.objenesis:objenesis:jar:3.2:test
[INFO] +- org.assertj:assertj-core:jar:3.21.0:test
[INFO] +- org.slf4j:slf4j-api:jar:1.7.32:compile
[INFO] \- ch.qos.logback:logback-classic:jar:1.2.5:test
[INFO]    \- ch.qos.logback:logback-core:jar:1.2.5:test
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  4.102 s
[INFO] Finished at: 2021-11-12T16:14:51+01:00
[INFO] ------------------------------------------------------------------------

Looking at the pom.xml I see that commons-logging:commons-logging is explicitly excluded from org.springframework:spring-context, org.elasticsearch.client:elasticsearch-rest-high-level-client and com.github.tomakehurst:wiremock-jre8 (the last one has test scope).

@sothawo sothawo added the status: waiting-for-feedback We need additional information before we can continue label Nov 12, 2021
@wilkinsona
Copy link
Member Author

My bad. It was our own dependency on elasticsearch-rest-high-level-client without an exclude and Gradle requiring every route to a dependency to exclude it for the exclude to be effective that made it look as if spring-data-elasticsearch was still pulling it in:

commons-logging:commons-logging:1.1.3 -> 1.2
\--- org.elasticsearch.client:elasticsearch-rest-client:7.9.3
     +--- compileClasspath (requested org.elasticsearch.client:elasticsearch-rest-client)
     +--- project :spring-boot-project:spring-boot-dependencies
     |    \--- project :spring-boot-project:spring-boot-parent
     |         \--- compileClasspath
     +--- org.elasticsearch.client:elasticsearch-rest-high-level-client:7.9.3
     |    +--- project :spring-boot-project:spring-boot-dependencies (*)
     |    \--- org.springframework.data:spring-data-elasticsearch:4.1.15-SNAPSHOT:20211111.180753-35
     |         +--- compileClasspath (requested org.springframework.data:spring-data-elasticsearch)
     |         \--- org.springframework.data:spring-data-bom:2020.0.15-SNAPSHOT:20211112.080327-231
     |              \--- project :spring-boot-project:spring-boot-dependencies (*)
     \--- org.elasticsearch.plugin:reindex-client:7.9.3
          \--- org.elasticsearch.client:transport:7.9.3
               +--- project :spring-boot-project:spring-boot-dependencies (*)
               \--- org.springframework.data:spring-data-elasticsearch:4.1.15-SNAPSHOT:20211111.180753-35 (*)

Sorry for the noise.

BTW, you can remove the commons-logging:commons-logging exclusion from spring-context as it no longer depends upon it.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Nov 12, 2021
@sothawo
Copy link
Collaborator

sothawo commented Nov 12, 2021

ok, thanks for the info. I'll close this issue with the PR that will remove this exclusion later on

@wilkinsona
Copy link
Member Author

I take that back. There is a problem, although it only occurs with Gradle. Unfortunately, Gradle doesn't apply Maven's own exclusion semantics when it's resolving dependencies using Maven's metadata (a pom file). Instead, it requires every path to a dependency to exclude it for the exclusion to be effective. In this case, there's a path through org.elasticsearch.client:transport to commons-logging:commons-logging that doesn't exclude it so it appears on the classpath of a project consuming spring-data-elasticsearch using Gradle.

Could you please add an exclusion of commons-logging:commons-logging to the org.elasticsearch.client:transport dependency?

@sothawo
Copy link
Collaborator

sothawo commented Nov 12, 2021

The whole dependency to the transport client will be gone from the main branch with the next commit I'll merge in. So that will be automatically resolved by that.

@wilkinsona
Copy link
Member Author

Thanks. Could you consider doing something similar in the active maintenance branches too please? It was the 4.1.x branch where I first saw this.

@sothawo
Copy link
Collaborator

sothawo commented Nov 12, 2021

there I need to add the exclusion, because the transport client is used in them, I'll do that for 4.1 and 4.2 then

@sothawo
Copy link
Collaborator

sothawo commented Nov 12, 2021

But what makes me wonder: why can't I see this dependency in maven? If I take out the existing exclusion, I can only see commons-logging as a transitive dependency of the rest client, but not of the transport-client

@wilkinsona
Copy link
Member Author

I think it's just due to the way that Maven shows you the dependency graph.

@sothawo
Copy link
Collaborator

sothawo commented Nov 13, 2021

I just created a project with the spring initializer (boot 2.4.12, that uses Spring Data Elasticsearch 4.1.12, gradle) and tried to see the dependency there. I ran gradle build --scan but in the build scan I cannot find commons-logging. How can I reproduce that?

@wilkinsona
Copy link
Member Author

I saw the problem in Spring Boot's build. If you remove this line commons-logging will appear on the compile classpath. Let me see if I can reduce that down to something much simpler.

@sothawo
Copy link
Collaborator

sothawo commented Nov 13, 2021

Ok, I found it. commons-logging is pulled in by the Elasticsearch low level rest client (https://mvnrepository.com/artifact/org.elasticsearch.client/elasticsearch-rest-client/7.15.2). This in turn is pulled in by the Elasticsearch RestHighLevelClient and by the transport client (here indirectly with an additional intermediate elasticsearch plugin).

So this problem will even persist when using the new upcoming Elasticsearch client, as this will replace the high level client but still will need the low level client (which is Apache 2 licensed, so it is no problem to use it).

So I will add the exclusion in the current main to the high-level and low-level clients and in the 4.3 - 4.1 branches additionally to the transport-client dependencies.

@wilkinsona
Copy link
Member Author

wilkinsona commented Nov 13, 2021

Excellent. Just in case it's still useful, here's a minimal Gradle script that shows the problem:

plugins {
	id "java"
}

group = "com.example"
version = "0.0.1-SNAPSHOT"
sourceCompatibility = "11"

repositories {
	mavenCentral()
}

dependencies {
	implementation(platform("org.springframework.data:spring-data-bom:2020.0.14"))
	implementation("org.springframework.data:spring-data-elasticsearch")
}
$ ./gradlew dependencyInsight --dependency commons-logging                                 

> Task :dependencyInsight
commons-logging:commons-logging:1.1.3
   variant "compile" [
      org.gradle.status              = release (not requested)
      org.gradle.usage               = java-api
      org.gradle.libraryelements     = jar (compatible with: classes)
      org.gradle.category            = library

      Requested attributes not found in the selected variant:
         org.gradle.dependency.bundling = external
         org.gradle.jvm.environment     = standard-jvm
         org.gradle.jvm.version         = 11
   ]

commons-logging:commons-logging:1.1.3
\--- org.elasticsearch.client:elasticsearch-rest-client:7.9.3
     +--- org.elasticsearch.client:elasticsearch-rest-high-level-client:7.9.3
     |    \--- org.springframework.data:spring-data-elasticsearch:4.1.14
     |         +--- compileClasspath (requested org.springframework.data:spring-data-elasticsearch)
     |         \--- org.springframework.data:spring-data-bom:2020.0.14
     |              \--- compileClasspath
     \--- org.elasticsearch.plugin:reindex-client:7.9.3
          \--- org.elasticsearch.client:transport:7.9.3
               \--- org.springframework.data:spring-data-elasticsearch:4.1.14 (*)

(*) - dependencies omitted (listed previously)

A web-based, searchable dependency report is available by adding the --scan option.

BUILD SUCCESSFUL in 518ms
1 actionable task: 1 executed

sothawo added a commit to sothawo/spring-data-elasticsearch that referenced this issue Nov 13, 2021
sothawo added a commit that referenced this issue Nov 13, 2021
sothawo added a commit that referenced this issue Nov 13, 2021
Original Pull Request #1993
Closes #1989

(cherry picked from commit 95401a5)
sothawo added a commit that referenced this issue Nov 13, 2021
Original Pull Request #1993
Closes #1989

(cherry picked from commit 95401a5)
(cherry picked from commit 15ca49a)
@sothawo
Copy link
Collaborator

sothawo commented Nov 13, 2021

fixed in main, 4.3.x, 4.x.2 and 4.1.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: feedback-provided Feedback has been provided status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
3 participants