From 7be86f3d828a7372cd908b7a3c1930b428fbed76 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 --- 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 87d1ef96bf..7700287009 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) ### Removed ### Fixed + - [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 c1cd4a7187..506ac20046 100644 --- a/java-client/build.gradle.kts +++ b/java-client/build.gradle.kts @@ -55,6 +55,12 @@ plugins { } apply(plugin = "opensearch.repositories") +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));