xxubai commented on code in PR #13740:
URL: https://github.com/apache/gravitino/pull/13740#discussion_r4244528858


##########
flink-connector/v2.2/flink/build.gradle.kts:
##########
@@ -0,0 +1,279 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+plugins {
+  `maven-publish`
+  id("java")
+  id("idea")
+}
+
+repositories {
+  mavenCentral()
+}
+
+// flink-common's sources are compiled directly into this module's own 
sourceSet (in addition
+// to flink-common's own jar) so that they are re-checked against this 
module's own
+// Flink/Iceberg/Paimon dependency versions (this matters once versions 
diverge in incompatible
+// ways, e.g. Flink 2.x removing APIs that are still present in the 1.x line).
+val commonProject = project(":flink-connector:flink-common")
+
+sourceSets {
+  main {
+    java.srcDir(commonProject.file("src/main/java"))
+  }
+  test {
+    java.srcDir(commonProject.file("src/test/java"))
+    resources.srcDir(commonProject.file("src/test/resources"))
+  }
+}
+
+// Spotless can't format files outside the project dir; flink-common's own 
sources are linted
+// by the flink-common project itself, so restrict this project's spotless 
target to its own.
+plugins.withType<com.diffplug.gradle.spotless.SpotlessPlugin>().configureEach {
+  configure<com.diffplug.gradle.spotless.SpotlessExtension> {
+    java {
+      target("src/**/*.java")
+    }
+  }
+}
+
+val flinkVersion: String = libs.versions.flink22.get()
+val flinkMajorVersion: String = flinkVersion.substringBeforeLast(".")
+val icebergVersion: String = libs.versions.iceberg4flink22.get()
+val paimonVersion: String = libs.versions.paimon4flink22.get()
+// This connector uses Flink Java APIs, so its artifacts need no Scala-version 
suffix.
+// Flink internals still use Scala.
+val artifactName = "${rootProject.name}-flink-$flinkMajorVersion"
+
+dependencies {
+  constraints {
+    // Force upgrade for outdated transitive libthrift pulled by Hive Metastore
+    compileOnly(libs.thrift)
+    testImplementation(libs.thrift)
+    // flink-connector-jdbc-core transitively pulls 
openlineage-sql-java:1.32.0, whose bundled,
+    // unrelocated org.apache.commons.lang3.SystemProperties predates the 
getUserName(String)
+    // overload and shadows the real commons-lang3 on the classpath 
(NoSuchMethodError). This
+    // can't simply be excluded: the connector's lineage extraction actually 
calls into it at
+    // runtime (JdbcSource.getLineageVertex). Force this newer release 
instead, which ships an
+    // up-to-date bundled copy.
+    compileOnly(libs.openlineageSqlJava21)

Review Comment:
   renamed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to