From b68e25b01d87aeeb7680405713e19cc3caf720b7 Mon Sep 17 00:00:00 2001 From: Jerry Shao Date: Thu, 7 Nov 2024 15:24:53 +0800 Subject: [PATCH] Improve the gradle to skip some modules to avoid publishing empty jars --- build.gradle.kts | 14 +++++++++++--- dev/release/release-build.sh | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index e6c49df4064..23074cbe028 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -401,9 +401,17 @@ subprojects { publishing { publications { create("MavenJava") { - from(components["java"]) - artifact(sourcesJar) - artifact(javadocJar) + if (project.name == "web" || + project.name == "docs" || + project.name == "integration-test" || + project.name == "integration-test-common" + ) { + setArtifacts(emptyList()) + } else { + from(components["java"]) + artifact(sourcesJar) + artifact(javadocJar) + } pom { name.set("Gravitino") diff --git a/dev/release/release-build.sh b/dev/release/release-build.sh index 45617c76e37..d6ae00038da 100755 --- a/dev/release/release-build.sh +++ b/dev/release/release-build.sh @@ -360,7 +360,7 @@ if [[ "$1" == "publish-release" ]]; then if ! is_dry_run; then nexus_upload=$NEXUS_ROOT/deployByRepositoryId/$staged_repo_id echo "Uploading files to $nexus_upload" - for file in $(find . -type f -not -path "./docs/*" -not -path "./web/*") + for file in $(find . -type f -not -path "./docs/*" -not -path "./web/*" -not -path "./integration-test-common/*" -not -path "./integration-test/*") do # strip leading ./ file_short=$(echo $file | sed -e "s/\.\///")