From 16d4602571a7f56cf34b8ad99cc747ec325328cf Mon Sep 17 00:00:00 2001 From: Peter Nied Date: Mon, 21 Aug 2023 21:56:22 +0000 Subject: [PATCH] Remove jarhell check disablement JarHell was disabled due to an issue with Kafka where there were multiple copies of the same class packaged inside of a release and test distribution jar. This was resolved with https://github.com/apache/kafka/pull/12407 The Kafka change has been merged, released, and pulled into this repository so we are removing the workaround to supress jar hell issue detection. - Resolves #1938 Signed-off-by: Peter Nied --- build.gradle | 3 +- .../org/opensearch/bootstrap/JarHell.java | 39 ------------------- 2 files changed, 1 insertion(+), 41 deletions(-) delete mode 100644 src/test/java/org/opensearch/bootstrap/JarHell.java diff --git a/build.gradle b/build.gradle index 0f7d746b0b..8b36328438 100644 --- a/build.gradle +++ b/build.gradle @@ -106,8 +106,7 @@ forbiddenApisTest.enabled = false filepermissions.enabled = false forbiddenPatterns.enabled = false testingConventions.enabled = false -// Conflicts between runtime kafka-clients:x.y.z & testRuntime kafka-clients:x.y.z:test -jarHell.enabled = false +jarHell.enabled = true tasks.whenTaskAdded {task -> if(task.name.contains("forbiddenApisIntegrationTest")) { task.enabled = false diff --git a/src/test/java/org/opensearch/bootstrap/JarHell.java b/src/test/java/org/opensearch/bootstrap/JarHell.java deleted file mode 100644 index 3024a169bc..0000000000 --- a/src/test/java/org/opensearch/bootstrap/JarHell.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -package org.opensearch.bootstrap; - -import java.io.IOException; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.HashSet; -import java.util.Set; -import java.util.function.Consumer; - -/** - * Disable JarHell to unblock test development - * https://github.com/opensearch-project/security/issues/1938 - */ -public class JarHell { - private JarHell() {} - - public static void checkJarHell(Consumer output) throws IOException, Exception {} - - public static void checkJarHell(Set urls, Consumer output) throws URISyntaxException, IOException {} - - public static void checkVersionFormat(String targetVersion) {} - - public static void checkJavaVersion(String resource, String targetVersion) {} - - public static Set parseClassPath() { - return new HashSet(); - } -}