You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by da...@apache.org on 2026/04/20 01:54:55 UTC

(hudi) branch master updated: fix: whitelist Flink _2.12 artifacts in scala-2.13 enforcer rule (#18508)

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

danny0405 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hudi.git


The following commit(s) were added to refs/heads/master by this push:
     new 937a64a2f4c5 fix: whitelist Flink _2.12 artifacts in scala-2.13 enforcer rule (#18508)
937a64a2f4c5 is described below

commit 937a64a2f4c5d96a5c6760e5646ed3017debeec2
Author: voonhous <vo...@gmail.com>
AuthorDate: Mon Apr 20 09:54:48 2026 +0800

    fix: whitelist Flink _2.12 artifacts in scala-2.13 enforcer rule (#18508)
    
    * fix: whitelist Flink _2.12 artifacts in scala-2.13 enforcer rule
    
    - Flink only publishes flink-table-planner_2.12 (no _2.13 variant exists). The scala-2.13 profile's blanket ban on *_2.12 artifacts breaks the build when combining -Dspark4.0 -Dscala-2.13 with -Dflink1.20.
    - Add <includes> exceptions for org.apache.flink:*_2.12 and its transitive _2.12 dependencies (org.scala-lang.modules, com.twitter) since Flink has largely decoupled from Scala since 1.15 and the _2.12 suffix is internal.
    
    * fix: tighten Flink _2.12 whitelist and add rationale comment
    
    Address review feedback on #18508:
    - Narrow scala-lang.modules and com.twitter includes to the specific transitives (scala-xml_2.12, chill_2.12) so the enforcer still catches unexpected _2.12 leakage from those groups.
    - Add an XML comment explaining why these _2.12 artifacts are whitelisted despite the blanket scala-2.13 ban (Flink's _2.12 suffix is a legacy naming artifact post 1.15 Scala decoupling).
---
 pom.xml | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/pom.xml b/pom.xml
index d3e1fa45b1df..8b73ad861c65 100644
--- a/pom.xml
+++ b/pom.xml
@@ -2487,6 +2487,21 @@
                         <exclude>*:*_2.11</exclude>
                         <exclude>*:*_2.12</exclude>
                       </excludes>
+                      <!--
+                        Flink decoupled from Scala starting 1.15; the `_2.12` suffix on
+                        flink-table-planner and its transitives (scala-xml, chill) is a
+                        legacy naming artifact, not a real Scala 2.12 binary dependency.
+                        Flink publishes no `_2.13` variant of flink-table-planner, so
+                        building with `-Dscala-2.13` together with any Flink profile
+                        (e.g. `-Dflink1.20`) would otherwise trip the blanket `*:*_2.12`
+                        ban above. Whitelist only the Flink-side transitives that
+                        actually surface here.
+                      -->
+                      <includes>
+                        <include>org.apache.flink:*_2.12</include>
+                        <include>org.scala-lang.modules:scala-xml_2.12</include>
+                        <include>com.twitter:chill_2.12</include>
+                      </includes>
                     </bannedDependencies>
                   </rules>
                 </configuration>