Skip to content

Remove the gradle-wrapper.jar#1461

Merged
mmat11 merged 8 commits into
open-telemetry:mainfrom
MrAlias:rm-gradle-wrapper-jar
Mar 5, 2026
Merged

Remove the gradle-wrapper.jar#1461
mmat11 merged 8 commits into
open-telemetry:mainfrom
MrAlias:rm-gradle-wrapper-jar

Conversation

@MrAlias
Copy link
Copy Markdown
Contributor

@MrAlias MrAlias commented Mar 4, 2026

Stop tracking the binary Gradle wrapper JAR in git history. Update the Gradle wrapper JAR/workflow from the Java integration and standardizes builds on the host/container gradle CLI.

Changes

  • Removed wrapper artifacts/scripts from pkg/internal/java (gradle-wrapper.jar, gradlew, gradlew.bat, wrapper properties).
  • Updated Java build/test/format paths to use gradle directly in:
    • .github/workflows/java-agent.yml
    • Makefile
    • Dockerfile
    • javaagent.Dockerfile
    • internal/test/integration/components/obi/Dockerfile-with-javaagent
  • Updated Java docs to reflect current prerequisites and build commands:
    • pkg/internal/java/README.md
    • pkg/internal/java/agent/src/jmh/.../BENCHMARK_README.md
  • Refreshed embedded Java agent artifact: pkg/internal/java/embedded/obi-java-agent.jar.

Fixes

Added fix for Java 8 CI correctness by enforcing Java 8 API targeting at compile time (options.release = 8 in the Java Gradle config). This prevents newer-JDK method signatures from leaking into compiled classes (e.g., ByteBuffer.flip()/position() return types), which caused NoSuchMethodError when tests were executed on JDK 8. The Java 8 matrix path now runs successfully with Gradle on the pinned JDK and tests on the matrix JDK.

Validation

  • Java notices are up to date (make java-notices-update produced no diffs).
  • Updated Docker build paths were validated by building changed Docker targets successfully.

@MrAlias MrAlias added this to the v0.6.0 milestone Mar 4, 2026
@MrAlias MrAlias force-pushed the rm-gradle-wrapper-jar branch from 3fa41c0 to 1cb1d69 Compare March 4, 2026 19:12
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 43.90%. Comparing base (cc5693e) to head (5ac8851).
⚠️ Report is 11 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1461   +/-   ##
=======================================
  Coverage   43.90%   43.90%           
=======================================
  Files         313      313           
  Lines       34213    34213           
=======================================
  Hits        15022    15022           
  Misses      18213    18213           
  Partials      978      978           
Flag Coverage Δ
integration-test 21.71% <ø> (-0.04%) ⬇️
integration-test-arm 0.00% <ø> (ø)
integration-test-vm-x86_64-5.15.152 0.00% <ø> (ø)
integration-test-vm-x86_64-6.10.6 0.00% <ø> (ø)
k8s-integration-test 2.29% <ø> (ø)
oats-test 0.00% <ø> (ø)
unittests 44.89% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@MrAlias MrAlias marked this pull request as ready for review March 4, 2026 19:37
@MrAlias MrAlias requested a review from a team as a code owner March 4, 2026 19:37
Copilot AI review requested due to automatic review settings March 4, 2026 19:37
@MrAlias
Copy link
Copy Markdown
Contributor Author

MrAlias commented Mar 4, 2026

@grcevski thoughts?

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR removes the Gradle wrapper artifacts from the embedded Java agent project and updates build/CI/Docker/documentation to use the host/container gradle CLI instead, reducing tracked binary wrapper files in the repo.

Changes:

  • Removed Gradle wrapper scripts/config (including the tracked wrapper JAR) from pkg/internal/java.
  • Updated CI, Make targets, and Docker build steps to invoke gradle directly.
  • Updated Java agent docs/benchmark docs to reflect the new build prerequisites/commands, and refreshed the embedded agent JAR.

Reviewed changes

Copilot reviewed 10 out of 12 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
pkg/internal/java/gradlew.bat Removed Windows Gradle wrapper script.
pkg/internal/java/gradlew Removed POSIX Gradle wrapper script.
pkg/internal/java/gradle/wrapper/gradle-wrapper.properties Removed wrapper configuration (no longer pinning Gradle via wrapper).
pkg/internal/java/gradle/wrapper/gradle-wrapper.jar Removed tracked wrapper binary.
pkg/internal/java/agent/src/jmh/java/io/opentelemetry/obi/java/instrumentations/util/BENCHMARK_README.md Updated benchmark commands to use gradle (needs minor doc clarification).
pkg/internal/java/README.md Updated prerequisites and build commands for wrapper-less workflows.
.github/workflows/java-agent.yml Switched CI steps from ./gradlew to gradle.
Makefile Switched Java targets from wrapper to gradle and added JAVA_HOME selection based on .java-version.
Dockerfile Switched Java agent build step from wrapper to gradle.
javaagent.Dockerfile Switched Java agent build step from wrapper to gradle.
internal/test/integration/components/obi/Dockerfile-with-javaagent Switched integration image Java agent build step from wrapper to gradle.
pkg/internal/java/embedded/obi-java-agent.jar Refreshed embedded agent artifact (binary update).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/java-agent.yml Outdated
Comment thread .github/workflows/java-agent.yml Outdated
@MrAlias
Copy link
Copy Markdown
Contributor Author

MrAlias commented Mar 4, 2026

Looks like Java 8 testing wasn't actually testing against Java 8. Pushed a fix here.

Copy link
Copy Markdown
Contributor

@grcevski grcevski left a comment

Choose a reason for hiding this comment

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

LGTM! Yeah we should remove them, the build will make them anyway.

@mmat11 mmat11 merged commit abe4616 into open-telemetry:main Mar 5, 2026
86 of 87 checks passed
@MrAlias MrAlias deleted the rm-gradle-wrapper-jar branch March 5, 2026 15:32
@MrAlias MrAlias mentioned this pull request Mar 5, 2026
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.

4 participants