From aaee28ddb78e37d5f502161d48cb97b11a692e5f Mon Sep 17 00:00:00 2001 From: Stefan Schmid Date: Thu, 2 Nov 2023 16:42:52 +0100 Subject: [PATCH 1/2] Manually relocate snakeyaml multi-release classes. The multi-release classes for the relocated snakeyaml dependency need to be relocated manually due to a bug in the Maven Shade plugin. The plugin only relocates the content but not the package structure itself. See https://issues.apache.org/jira/browse/MSHADE-406. --- pom.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pom.xml b/pom.xml index 8775dace7..701a327dd 100644 --- a/pom.xml +++ b/pom.xml @@ -291,6 +291,13 @@ org.yaml.snakeyaml net.datafaker.shaded.snakeyaml + + + META-INF/versions/9/org.yaml.snakeyaml + META-INF/versions/9/net.datafaker.shaded.snakeyaml + com.mifmif.common.regex net.datafaker.shaded.generex From 9e46f75bc8c0b2600068acf0f2321e54bb89df94 Mon Sep 17 00:00:00 2001 From: Stefan Schmid Date: Thu, 2 Nov 2023 21:40:57 +0100 Subject: [PATCH 2/2] Use a regex pattern to match possible future multi-release versions. This is an undocumented feature of the Maven Shade plugin, see plugin code: https://github.com/apache/maven-shade-plugin/blob/master/src/main/java/org/apache/maven/plugins/shade/relocation/SimpleRelocator.java. --- pom.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 701a327dd..6a783a168 100644 --- a/pom.xml +++ b/pom.xml @@ -295,8 +295,9 @@ needed due to a bug in the Maven Shade plugin, which only relocates the content but not the package structure itself, see https://issues.apache.org/jira/browse/MSHADE-406. --> - META-INF/versions/9/org.yaml.snakeyaml - META-INF/versions/9/net.datafaker.shaded.snakeyaml + META-INF/versions/(\d+)/org/yaml/snakeyaml + META-INF/versions/$1/net/datafaker/shaded/snakeyaml + true com.mifmif.common.regex