-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JacocoCoverage_jarjar_deploy.jar should shade its internal copy of Guava #12998
Comments
Following appears to have done the trick. diff --git a/src/java_tools/junitrunner/java/com/google/testing/coverage/JacocoCoverage.jarjar b/src/java_tools/junitrunner/java/com/google/testing/coverage/JacocoCoverage.jarjar
index 56190d874c..081c5420f8 100644
--- a/src/java_tools/junitrunner/java/com/google/testing/coverage/JacocoCoverage.jarjar
+++ b/src/java_tools/junitrunner/java/com/google/testing/coverage/JacocoCoverage.jarjar
@@ -1,2 +1,3 @@
+rule com.google.common.** com.google.testing.coverage.jarjar.@0
rule org.apache.commons.** com.google.testing.coverage.jarjar.@0
rule org.objectweb.asm.** com.google.testing.coverage.jarjar.@0 |
Can you submit a PR? |
Sorry to revive this old issue but I can't find this information anywhere else. I'm getting this exact problem in one huge Java repository; I noticed this patch made it into Bazel 5, but unfortunately I'm using version 4.2.2 and upgrading is not an option for now. How did you test this in-place? Is there any way I can configure Bazel to forcefully introduce this patch to Jacoco? |
@JaimeLotero We build java_tools from source.
Hope this helps. |
@beasleyr-vmw thank you so much for the detailed explanation, that did the job. |
One of my users has some ancient tests which are built against Guava 18. Upon upgrading to Bazel 4 with java_tools javac11-10.5, the test fails when running under
bazel coverage
.This method was flagged as deprecated and slated for removal in Guava 20.0.
Analysis revealed that Bazel inserts
JacocoCoverage_jarjar_deploy.jar
near the head ofCLASSPATH
, and this jar contains its own, newer copy of Guava. However, the embedded Guava classes aren't shaded and so take precedence over the user's desired version.Would this "just" require adding rule(s) to src/java_tools/junitrunner/java/com/google/testing/coverage/JacocoCoverage.jarjar ?
The text was updated successfully, but these errors were encountered: