This is an automated email from the ASF dual-hosted git repository.

snuyanzin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink-shaded.git


The following commit(s) were added to refs/heads/master by this push:
     new eaf17e0  [FLINK-39557] Generate correct Multi-Release JAR files for 
Jackson and Swagger
eaf17e0 is described below

commit eaf17e088bfb66fbbc2ec0845038a3c0f97255fd
Author: Piotr Przybylski <[email protected]>
AuthorDate: Mon May 4 13:50:41 2026 +0200

    [FLINK-39557] Generate correct Multi-Release JAR files for Jackson and 
Swagger
---
 flink-shaded-jackson-parent/flink-shaded-jackson-2/pom.xml     |  7 +++++++
 .../flink-shaded-jackson-module-jsonSchema-2/pom.xml           |  7 +++++++
 flink-shaded-jackson-parent/pom.xml                            | 10 ++++++++++
 flink-shaded-swagger/pom.xml                                   |  7 +++++++
 pom.xml                                                        |  2 ++
 5 files changed, 33 insertions(+)

diff --git a/flink-shaded-jackson-parent/flink-shaded-jackson-2/pom.xml 
b/flink-shaded-jackson-parent/flink-shaded-jackson-2/pom.xml
index e755e71..e01a48e 100644
--- a/flink-shaded-jackson-parent/flink-shaded-jackson-2/pom.xml
+++ b/flink-shaded-jackson-parent/flink-shaded-jackson-2/pom.xml
@@ -98,6 +98,13 @@ under the License.
                                     </shadedPattern>
                                 </relocation>
                             </relocations>
+                            <transformers combine.children="append">
+                                <transformer 
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
+                                    <manifestEntries>
+                                        <Multi-Release>true</Multi-Release>
+                                    </manifestEntries>
+                                </transformer>
+                            </transformers>
                         </configuration>
                     </execution>
                 </executions>
diff --git 
a/flink-shaded-jackson-parent/flink-shaded-jackson-module-jsonSchema-2/pom.xml 
b/flink-shaded-jackson-parent/flink-shaded-jackson-module-jsonSchema-2/pom.xml
index ef23b4e..58d5700 100644
--- 
a/flink-shaded-jackson-parent/flink-shaded-jackson-module-jsonSchema-2/pom.xml
+++ 
b/flink-shaded-jackson-parent/flink-shaded-jackson-module-jsonSchema-2/pom.xml
@@ -80,6 +80,13 @@ under the License.
                                     </shadedPattern>
                                 </relocation>
                             </relocations>
+                            <transformers combine.children="append">
+                                <transformer 
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
+                                    <manifestEntries>
+                                        <Multi-Release>true</Multi-Release>
+                                    </manifestEntries>
+                                </transformer>
+                            </transformers>
                         </configuration>
                     </execution>
                 </executions>
diff --git a/flink-shaded-jackson-parent/pom.xml 
b/flink-shaded-jackson-parent/pom.xml
index 7ddcdf2..4c3fbbc 100644
--- a/flink-shaded-jackson-parent/pom.xml
+++ b/flink-shaded-jackson-parent/pom.xml
@@ -80,6 +80,16 @@ under the License.
                                     <pattern>com.fasterxml.jackson</pattern>
                                     
<shadedPattern>${shading.prefix}.jackson2.com.fasterxml.jackson</shadedPattern>
                                 </relocation>
+                                <!--
+                                Manually relocate multi-release classes to the 
correct shaded package. This is needed
+                                due to a bug in the Maven Shade plugin, which 
only relocates the content but not
+                                the package structure itself, see 
https://github.com/apache/maven-shade-plugin/issues/652
+                                -->
+                                <relocation>
+                                    
<pattern>META-INF/versions/(\d+)/(.+)/</pattern>
+                                    
<shadedPattern>META-INF/versions/$1/${shading.prefix-directory}/jackson2/$2/</shadedPattern>
+                                    <rawString>true</rawString>
+                                </relocation>
                             </relocations>
                         </configuration>
                     </execution>
diff --git a/flink-shaded-swagger/pom.xml b/flink-shaded-swagger/pom.xml
index beec003..9449ac9 100644
--- a/flink-shaded-swagger/pom.xml
+++ b/flink-shaded-swagger/pom.xml
@@ -96,6 +96,13 @@ under the License.
                                     
<shadedPattern>${shading.prefix}.jackson2.com.fasterxml.jackson</shadedPattern>
                                 </relocation>
                             </relocations>
+                            <transformers combine.children="append">
+                                <transformer 
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
+                                    <manifestEntries>
+                                        <Multi-Release>true</Multi-Release>
+                                    </manifestEntries>
+                                </transformer>
+                            </transformers>
                         </configuration>
                     </execution>
                 </executions>
diff --git a/pom.xml b/pom.xml
index 578c605..ec10dff 100644
--- a/pom.xml
+++ b/pom.xml
@@ -62,6 +62,7 @@ under the License.
 
     <properties>
         <shading.prefix>org.apache.flink.shaded</shading.prefix>
+        
<shading.prefix-directory>org/apache/flink/shaded</shading.prefix-directory>
         <netty.version>4.2.12.Final</netty.version>
         <jackson.version>2.20.1</jackson.version>
         <jsonpath.version>2.10.0</jsonpath.version>
@@ -184,6 +185,7 @@ under the License.
                                 <artifact>*</artifact>
                                 <excludes>
                                     <exclude>META-INF/maven/**</exclude>
+                                    <exclude>**/module-info.class</exclude>
                                 </excludes>
                             </filter>
                         </filters>

Reply via email to