From d7286433bb81598d5b7f5bb9a93e9eab6dcb1a29 Mon Sep 17 00:00:00 2001 From: Andriy Redko Date: Wed, 13 Sep 2023 11:29:06 -0400 Subject: [PATCH] JarHell caused by latest software.amazon.awssdk 2.20.141 (#616) Signed-off-by: Andriy Redko (cherry picked from commit 7be86f3d828a7372cd908b7a3c1930b428fbed76) --- CHANGELOG.md | 1 + java-client/build.gradle.kts | 6 ++++++ .../client/opensearch/integTest/AbstractCatClientIT.java | 8 +++++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 45aee9f155..ad97a7c094 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) ### Fixed - Fix PutMappingRequest by removing unsupported fields ([#597](https://github.com/opensearch-project/opensearch-java/pull/597)) +- [BUG] JarHell caused by latest software.amazon.awssdk 2.20.141 ([#616](https://github.com/opensearch-project/opensearch-java/pull/616)) ### Security diff --git a/java-client/build.gradle.kts b/java-client/build.gradle.kts index 5096f81d83..97b9058993 100644 --- a/java-client/build.gradle.kts +++ b/java-client/build.gradle.kts @@ -51,6 +51,12 @@ plugins { id("com.github.jk1.dependency-license-report") version "2.5" } +configurations { + all { + exclude(group = "software.amazon.awssdk", module = "third-party-jackson-core") + } +} + checkstyle { toolVersion = "10.0" } diff --git a/java-client/src/test/java/org/opensearch/client/opensearch/integTest/AbstractCatClientIT.java b/java-client/src/test/java/org/opensearch/client/opensearch/integTest/AbstractCatClientIT.java index 7c6b1cdee5..1a1afc77bc 100644 --- a/java-client/src/test/java/org/opensearch/client/opensearch/integTest/AbstractCatClientIT.java +++ b/java-client/src/test/java/org/opensearch/client/opensearch/integTest/AbstractCatClientIT.java @@ -241,9 +241,15 @@ public void testCatPitSegments() throws Exception { .pitSegments(r -> r.headers("index,shard,id,segment,size")); assertNotNull("PitSegmentsResponse.segments() is null", PitSegmentsResponse.valueBody()); - assertTrue("PitSegmentsResponse.segments().size() == 0", + + if (Version.fromString(version).onOrAfter(Version.fromString("2.10.0"))) { + assertTrue("PitSegmentsResponse.segments().size() == 0", + PitSegmentsResponse.valueBody().isEmpty()); + } else { + assertTrue("PitSegmentsResponse.segments().size() == 0", PitSegmentsResponse.valueBody().size() > 0); } + } private void createIndex(String indexName) throws Exception { CreateIndexResponse createResponse = javaClient().indices().create(b -> b.index(indexName));