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

mchades pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/gravitino.git


The following commit(s) were added to refs/heads/main by this push:
     new 72b92d650 [#5489] fix(build): Improve the gradle to skip some modules 
to avoid publishing empty jars (#5501)
72b92d650 is described below

commit 72b92d6508387716044f08b60807c925f5f2ab41
Author: Jerry Shao <jerrys...@datastrato.com>
AuthorDate: Fri Nov 8 09:49:16 2024 +0800

    [#5489] fix(build): Improve the gradle to skip some modules to avoid 
publishing empty jars (#5501)
    
    ### What changes were proposed in this pull request?
    
    This PR improves the gradle and release script to skip some modules.
    
    ### Why are the changes needed?
    
    This is to avoid some unnecessary empty jars to be published to maven
    repo.
    
    Fix: #5489
    
    ### Does this PR introduce _any_ user-facing change?
    
    No.
    
    ### How was this patch tested?
    
    Tested locally.
---
 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 e6c49df40..23074cbe0 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -401,9 +401,17 @@ subprojects {
   publishing {
     publications {
       create<MavenPublication>("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<Any>())
+        } 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 45617c76e..d6ae00038 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/\.\///")

Reply via email to