mirror of
https://github.com/datahub-project/datahub.git
synced 2025-06-27 05:03:31 +00:00
build(gradle): version change (Gradle and shadow plugin) (#11999)
This commit is contained in:
parent
5617d6b447
commit
2291c71c29
@ -34,6 +34,7 @@ buildscript {
|
||||
// Releases: https://github.com/linkedin/rest.li/blob/master/CHANGELOG.md
|
||||
ext.pegasusVersion = '29.57.0'
|
||||
ext.mavenVersion = '3.6.3'
|
||||
ext.versionGradle = '8.11.1'
|
||||
ext.springVersion = '6.1.13'
|
||||
ext.springBootVersion = '3.2.9'
|
||||
ext.springKafkaVersion = '3.1.6'
|
||||
@ -78,7 +79,7 @@ buildscript {
|
||||
|
||||
plugins {
|
||||
id 'com.gorylenko.gradle-git-properties' version '2.4.1'
|
||||
id 'com.github.johnrengelman.shadow' version '8.1.1' apply false
|
||||
id 'com.gradleup.shadow' version '8.3.5' apply false
|
||||
id 'com.palantir.docker' version '0.35.0' apply false
|
||||
id 'com.avast.gradle.docker-compose' version '0.17.6'
|
||||
id "com.diffplug.spotless" version "6.23.3"
|
||||
@ -499,3 +500,8 @@ subprojects {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
wrapper {
|
||||
gradleVersion = project.versionGradle
|
||||
distributionType = Wrapper.DistributionType.ALL
|
||||
}
|
||||
|
@ -65,14 +65,14 @@ The sample authenticator implementation can be found at [Authenticator Sample](.
|
||||
3. Use `getResourceAsStream` to read files: If your plugin read any configuration file like properties or YAML or JSON or xml then use `this.getClass().getClassLoader().getResourceAsStream("<file-name>")` to read that file from DataHub GMS plugin's class-path. For DataHub GMS resource look-up behavior please refer [Plugin Installation](#plugin-installation) section. Sample code of `getResourceAsStream` is available in sample Authenticator plugin [TestAuthenticator.java](../metadata-service/plugin/src/test/sample-test-plugins/src/main/java/com/datahub/plugins/test/TestAuthenticator.java).
|
||||
|
||||
|
||||
4. Bundle your Jar: Use `com.github.johnrengelman.shadow` gradle plugin to create an uber jar.
|
||||
4. Bundle your Jar: Use `com.gradleup.shadow` gradle plugin to create an uber jar.
|
||||
|
||||
To see an example of building an uber jar, check out the `build.gradle` file for the apache-ranger-plugin file of [Apache Ranger Plugin](https://github.com/acryldata/datahub-ranger-auth-plugin/tree/main/apache-ranger-plugin) for reference.
|
||||
|
||||
Exclude signature files as shown in below `shadowJar` task.
|
||||
|
||||
```groovy
|
||||
apply plugin: 'com.github.johnrengelman.shadow';
|
||||
apply plugin: 'com.gradleup.shadow';
|
||||
shadowJar {
|
||||
// Exclude com.datahub.plugins package and files related to jar signature
|
||||
exclude "META-INF/*.RSA", "META-INF/*.SF","META-INF/*.DSA"
|
||||
@ -152,14 +152,14 @@ The sample authorizer implementation can be found at [Authorizer Sample](https:/
|
||||
|
||||
3. Use `getResourceAsStream` to read files: If your plugin read any configuration file like properties or YAML or JSON or xml then use `this.getClass().getClassLoader().getResourceAsStream("<file-name>")` to read that file from DataHub GMS plugin's class-path. For DataHub GMS resource look-up behavior please refer [Plugin Installation](#plugin-installation) section. Sample code of `getResourceAsStream` is available in sample Authenticator plugin [TestAuthenticator.java](../metadata-service/plugin/src/test/sample-test-plugins/src/main/java/com/datahub/plugins/test/TestAuthenticator.java).
|
||||
|
||||
4. Bundle your Jar: Use `com.github.johnrengelman.shadow` gradle plugin to create an uber jar.
|
||||
4. Bundle your Jar: Use `com.gradleup.shadow` gradle plugin to create an uber jar.
|
||||
|
||||
To see an example of building an uber jar, check out the `build.gradle` file for the apache-ranger-plugin file of [Apache Ranger Plugin](https://github.com/acryldata/datahub-ranger-auth-plugin/tree/main/apache-ranger-plugin) for reference.
|
||||
|
||||
Exclude signature files as shown in below `shadowJar` task.
|
||||
|
||||
```groovy
|
||||
apply plugin: 'com.github.johnrengelman.shadow';
|
||||
apply plugin: 'com.gradleup.shadow';
|
||||
shadowJar {
|
||||
// Exclude com.datahub.plugins package and files related to jar signature
|
||||
exclude "META-INF/*.RSA", "META-INF/*.SF","META-INF/*.DSA"
|
||||
|
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
4
gradle/wrapper/gradle-wrapper.properties
vendored
4
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,6 +1,8 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
|
||||
distributionSha256Sum=89d4e70e4e84e2d2dfbb63e4daa53e21b25017cc70c37e4eea31ee51fb15098a
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
34
gradlew
vendored
34
gradlew
vendored
@ -15,6 +15,8 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
@ -55,7 +57,7 @@
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
@ -83,10 +85,9 @@ done
|
||||
# This is normally unused
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
|
||||
' "$PWD" ) || exit
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
@ -133,10 +134,13 @@ location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD=java
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
if ! command -v java >/dev/null 2>&1
|
||||
then
|
||||
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
@ -144,7 +148,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
case $MAX_FD in #(
|
||||
max*)
|
||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC3045
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
@ -152,7 +156,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC3045
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
@ -197,11 +201,15 @@ if "$cygwin" || "$msys" ; then
|
||||
done
|
||||
fi
|
||||
|
||||
# Collect all arguments for the java command;
|
||||
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
||||
# shell script including quotes and variable substitutions, so put them in
|
||||
# double quotes to make sure that they get re-expanded; and
|
||||
# * put everything else in single quotes, so that it's not re-expanded.
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Collect all arguments for the java command:
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||
# and any embedded shellness will be escaped.
|
||||
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||
# treated as '${Hostname}' itself on the command line.
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
|
22
gradlew.bat
vendored
22
gradlew.bat
vendored
@ -13,6 +13,8 @@
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
@rem SPDX-License-Identifier: Apache-2.0
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@ -43,11 +45,11 @@ set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if %ERRORLEVEL% equ 0 goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
|
||||
@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
|
||||
|
@ -2,7 +2,7 @@ plugins {
|
||||
id("com.palantir.git-version") apply false
|
||||
}
|
||||
|
||||
apply plugin: 'com.github.johnrengelman.shadow'
|
||||
apply plugin: 'com.gradleup.shadow'
|
||||
apply plugin: 'java-library'
|
||||
apply plugin: 'signing'
|
||||
apply plugin: 'maven-publish'
|
||||
|
@ -2,7 +2,7 @@ plugins {
|
||||
id("com.palantir.git-version") apply false
|
||||
}
|
||||
apply plugin: 'java-library'
|
||||
apply plugin: 'com.github.johnrengelman.shadow'
|
||||
apply plugin: 'com.gradleup.shadow'
|
||||
apply plugin: 'signing'
|
||||
apply plugin: 'io.codearte.nexus-staging'
|
||||
apply plugin: 'maven-publish'
|
||||
|
@ -1,6 +1,6 @@
|
||||
plugins {
|
||||
id 'java-library'
|
||||
id 'com.github.johnrengelman.shadow'
|
||||
id 'com.gradleup.shadow'
|
||||
id 'signing'
|
||||
id 'io.codearte.nexus-staging'
|
||||
id 'maven-publish'
|
||||
|
@ -1,7 +1,7 @@
|
||||
plugins {
|
||||
id("com.palantir.git-version") apply false
|
||||
id 'java-library'
|
||||
id 'com.github.johnrengelman.shadow'
|
||||
id 'com.gradleup.shadow'
|
||||
id 'signing'
|
||||
id 'io.codearte.nexus-staging'
|
||||
id 'maven-publish'
|
||||
@ -23,7 +23,7 @@ dependencies {
|
||||
api project(':entity-registry')
|
||||
api project(':metadata-integration:java:datahub-event')
|
||||
implementation project(':metadata-integration:java:datahub-schematron:lib')
|
||||
|
||||
|
||||
implementation(externalDependency.kafkaAvroSerializer) {
|
||||
exclude group: "org.apache.avro"
|
||||
}
|
||||
@ -70,14 +70,14 @@ task validatePythonEnv(dependsOn: [":metadata-ingestion:installDev"]) {
|
||||
def venvPath = System.getProperty('python.venv.path', '../../../metadata-ingestion/venv')
|
||||
def isWindows = System.getProperty('os.name').toLowerCase().contains('windows')
|
||||
def pythonExe = isWindows ? "${venvPath}/Scripts/python.exe" : "${venvPath}/bin/python"
|
||||
|
||||
|
||||
def result = exec {
|
||||
commandLine pythonExe, "-c", "import sys; print(sys.executable)"
|
||||
ignoreExitValue = true
|
||||
standardOutput = new ByteArrayOutputStream()
|
||||
errorOutput = new ByteArrayOutputStream()
|
||||
}
|
||||
|
||||
|
||||
if (result.exitValue != 0) {
|
||||
throw new GradleException("Python virtual environment not properly set up at ${venvPath}")
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
plugins {
|
||||
id("com.palantir.git-version") apply false
|
||||
id 'java'
|
||||
id 'com.github.johnrengelman.shadow'
|
||||
id 'com.gradleup.shadow'
|
||||
id 'signing'
|
||||
id 'io.codearte.nexus-staging'
|
||||
id 'maven-publish'
|
||||
|
@ -3,7 +3,7 @@ plugins {
|
||||
id "application"
|
||||
}
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'com.github.johnrengelman.shadow'
|
||||
apply plugin: 'com.gradleup.shadow'
|
||||
apply plugin: 'signing'
|
||||
apply plugin: 'io.codearte.nexus-staging'
|
||||
apply plugin: 'maven-publish'
|
||||
|
@ -1,5 +1,5 @@
|
||||
apply plugin: 'java-library'
|
||||
apply plugin: 'com.github.johnrengelman.shadow'
|
||||
apply plugin: 'com.gradleup.shadow'
|
||||
apply plugin: 'signing'
|
||||
apply plugin: 'maven-publish'
|
||||
apply from: '../../../gradle/coverage/java-coverage.gradle'
|
||||
|
@ -2,7 +2,7 @@ plugins {
|
||||
id("com.palantir.git-version") apply false
|
||||
}
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'com.github.johnrengelman.shadow'
|
||||
apply plugin: 'com.gradleup.shadow'
|
||||
apply plugin: 'signing'
|
||||
apply plugin: 'io.codearte.nexus-staging'
|
||||
apply plugin: 'maven-publish'
|
||||
|
Loading…
x
Reference in New Issue
Block a user