blob: 268fb7f21bb9d27864004156fc09ecd1e59fa69f [file]
// 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.
apply from: "$rootDir/gradle/shadow.gradle"
configurations {
// Ensure tests see the unshaded (provided) Flink APIs for compilation
testImplementation.extendsFrom compileUnshaded
}
dependencies {
// Flink core APIs are marked as 'compileUnshaded' (Maven 'provided' scope
// per 35fce9ba24b2e376c65fd7a2c50a65ec0a33e02f).
// These are supplied by the Flink cluster at runtime and should NOT be bundled
// to avoid classpath conflicts and JAR bloat.
// See: https://nightlies.apache.org/flink/flink-docs-release-1.20/docs/dev/configuration/overview/
compileUnshaded libs.flinkStreamingJava
compileUnshaded libs.flinkCore
compileUnshaded libs.flinkClients
compileUnshaded libs.flinkConnectorBase
// Bundle flink-connector-kudu but exclude its kudu-client to avoid duplicates
implementation(libs.flinkConnectorKudu) {
exclude group: "org.apache.kudu", module: "kudu-client"
}
// Bundle our kudu-client (shaded) - will be used by connector at runtime
implementation project(path: ":kudu-client", configuration: "shadow")
testImplementation libs.junit
testImplementation libs.assertj
testImplementation libs.mockitoCore
testImplementation project(path: ":kudu-test-utils", configuration: "shadow")
testImplementation libs.log4jApi
testImplementation libs.log4jCore
testImplementation libs.log4jSlf4jImpl
testImplementation libs.flinkTestUtils
}
shadowJar {
dependencies {
exclude(dependency("com.twitter::.*"))
exclude(dependency("org.javassist::.*"))
exclude(dependency("org.lz4::.*"))
exclude(dependency("org.objenesis::.*"))
exclude(dependency("org.xerial.snappy::.*"))
exclude(dependency("org.yaml::.*"))
exclude "META-INF/licenses/**"
exclude "META-INF/services/org.apache.flink.*"
exclude "assets/**"
exclude "com/esotericsoftware/**"
exclude "flink-jaas.conf"
exclude "flink-rpc-akka.jar"
exclude "javax/annotation/**"
exclude "one/profiler/**"
exclude "org/snakeyaml/**"
// Do not bundle Hadoop classes; provided by the cluster
exclude "org/apache/hadoop/**"
// Avoid bundling commons-cli; use Flink's CLI at runtime
exclude "org/apache/commons/cli/**"
// Avoid bundling logging bindings; let cluster provide
exclude "org/slf4j/impl/**"
exclude "ch/qos/logback/**"
exclude "org/apache/log4j/**"
exclude "META-INF/*log4j*"
}
minimize()
}
// kudu-replication has no public Javadoc.
javadoc {
enabled = false
}