-
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
Bazel creates non-compliant classpath jar #10620
Comments
/cc @meteorcloudy |
Thanks for reporting this, I will look into this |
Any progress on this? |
@rivashin Sorry, I currently don't have any bandwidth to look into this. But I wound very much like to review the change if you can contribute to a fix! |
@mai93 maybe you want to look into this. :) |
I just put up a PR that updates the other Java launcher path #12946 |
…n in java_stub_template This PR fixes the url-encoding in `java_stub_template` to convert different special characters to their 2-digit hexadecimal representation. Fixes: bazelbuild#10620 Closes bazelbuild#12969. PiperOrigin-RevId: 355838382
…n in java_stub_template This PR fixes the url-encoding in `java_stub_template` to convert different special characters to their 2-digit hexadecimal representation. Fixes: bazelbuild#10620 Closes bazelbuild#12969. PiperOrigin-RevId: 355838382
…n in java_stub_template This PR fixes the url-encoding in `java_stub_template` to convert different special characters to their 2-digit hexadecimal representation. Fixes: bazelbuild#10620 Closes bazelbuild#12969. PiperOrigin-RevId: 355838382
Paths in the
Class-Path
attribute ofMANIFEST.MF
should be URL-encoded.Currently, bazel only encodes spaces:
bazel/src/tools/launcher/java_launcher.cc
Line 152 in 912e822
It should encode all other characters too, e.g.
%
- which is a valid character for a filename - should be replaced with%25
. If path is not encoded correctly then Java will not find the jar and will silently ignore it, resulting in a puzzling NoClassDefFoundError.Coursier generates paths with
%
when username/password or port is specified as part of maven repository URL:cache/v1/https/username%40server.com%3a8080/foo.jar
. As a result, any java project built with bazel & jvm_rules_external will experience this issue when the classpath gets long enough.See this small example reproducing the issue.
The text was updated successfully, but these errors were encountered: