Skip to content

Commit

Permalink
[#5489] fix(build): Improve the gradle to skip some modules to avoid …
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
jerryshao authored and web-flow committed Nov 8, 2024
1 parent e0de24d commit d7095f2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
14 changes: 11 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion dev/release/release-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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/\.\///")
Expand Down

0 comments on commit d7095f2

Please sign in to comment.