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

jshao pushed a commit to branch branch-0.7
in repository https://gitbox.apache.org/repos/asf/gravitino.git


The following commit(s) were added to refs/heads/branch-0.7 by this push:
     new 6be5fc2a7 [#5489] fix(build): Improve the gradle to skip some modules 
to avoid publishing empty jars (#5510)
6be5fc2a7 is described below

commit 6be5fc2a7abe95c467c2e3cb5840d42ff7a48d16
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Fri Nov 8 13:16:08 2024 +0800

    [#5489] fix(build): Improve the gradle to skip some modules to avoid 
publishing empty jars (#5510)
    
    ### 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.
    
    Co-authored-by: Jerry Shao <[email protected]>
---
 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 9c7135a0a..18d56ed63 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