Skip to content

Conversation

@cbb330
Copy link
Collaborator

@cbb330 cbb330 commented Jan 1, 2026

Summary

Remove shadowJar from build task to speed up development builds by 56%.

The build.dependsOn shadowJar was explicitly added but is unnecessary because the Shadow plugin's maven-publish integration already triggers shadowJar when running publish. CI workflows are unaffected since ./gradlew publish runs before Docker builds.

Build time improvement (./gradlew clean build -x test):

Time
Before 314s (5m 13s)
After 137s (2m 16s)
Improvement -177s (56% faster)

Changes

  • Client-facing API Changes
  • Internal API Changes
  • Bug Fixes
  • New Features
  • Performance Improvements
  • Code Style
  • Refactoring
  • Documentation
  • Tests

Performance Improvements

Removed tasks.build.dependsOn tasks.shadowJar from:

  • buildSrc/src/main/groovy/openhouse.apps-spark-common.gradle
  • tables-test-fixtures/tables-test-fixtures-iceberg-1.2/build.gradle
  • tables-test-fixtures/tables-test-fixtures-iceberg-1.5/build.gradle

Why this is safe:

  • publish task already triggers shadowJar via Shadow plugin's maven-publish integration
  • CI workflow runs ./gradlew publish before Docker builds
  • Tests that depend on configuration: 'shadow' still trigger shadowJar for their dependencies

Before (shadowJar runs on every build):

> Task :apps:openhouse-spark-apps_2.12:shadowJar
> Task :apps:openhouse-spark-apps-1.5_2.12:shadowJar
> Task :tables-test-fixtures:tables-test-fixtures_2.12:shadowJar
...
BUILD SUCCESSFUL in 5m 13s

After (shadowJar only runs on publish):

BUILD SUCCESSFUL in 2m 16s
250 actionable tasks: 244 executed, 6 up-to-date

Testing Done

  • Manually Tested on local docker setup. Please include commands ran, and their output.
  • Added new tests for the changes made.
  • Updated existing tests to reflect the changes made.
  • No tests added or updated. Please explain why. If unsure, please feel free to ask for help.
  • Some other form of testing like staging or soak time in production. Please explain.

Manual Testing

  1. Verified ./gradlew clean build -x test no longer runs shadowJar tasks
  2. Verified ./gradlew publish --dry-run still triggers shadowJar
  3. Measured before/after build times

No Tests Added

This is a build infrastructure change that doesn't affect runtime behavior.

Additional Information

  • Breaking Changes
  • Deprecations
  • Large PR broken into smaller PRs, and PR plan linked in the description.

🤖 Generated with Claude Code

The shadowJar task is already triggered by publish via the Shadow plugin's
maven-publish integration. Removing the explicit build.dependsOn shadowJar
speeds up ./gradlew build -x test by 56%.

CI workflows are unaffected because:
- Tests depend on shadow configuration → shadowJar runs for test deps
- publish task triggers shadowJar → Docker builds get uber JARs

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@cbb330 cbb330 changed the title Remove shadowJar from build task to speed up development builds Optimize build: Remove shadowJar from build task Jan 1, 2026
Copy link
Collaborator

@jiang95-dev jiang95-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The apps uber jar is needed for the local docker. We need to update the README to add gradle publish before building dockers. I think it's ok to remove shadow jar for tables-test-fixures, but keep the apps to minimze the build steps for users.

@cbb330
Copy link
Collaborator Author

cbb330 commented Jan 3, 2026

@jiang95-dev You are correct; this changes the workflow from ./gradlew build to ./gradlew build publish. However, this aligns with the default behavior of the shadowJar plugin in our other repos.

Mitigation Plan:

I will add a "heads up" notice and update the documentation in this PR.

I can also modify the Docker build command to throw a specific exception if the JAR is missing, explicitly instructing the user to run ./gradlew publish.

Motivation: Decoupling shadowJar from the app build significantly reduces build times. Since the standard build runs frequently (CI, post-merge, and ELR processes), the cumulative time savings are substantial.

@jiang95-dev
Copy link
Collaborator

Agree with the motivation. Can you update the readme?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants