Skip to content
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

Looks like maven:compile-only dependencies included in the java_export produced jar #1300

Open
gkdn opened this issue Dec 21, 2024 · 0 comments

Comments

@gkdn
Copy link
Contributor

gkdn commented Dec 21, 2024

It looks like java_export includes classes from targets marked with maven:compile_only.

I have seen this in google_bazel_common examples. For example:
AutoValue is such tagged target but I needed to exclude that from Closure Compiler in this PR.

Linked PR includes relevant test and should be reproducable by removing excluded_workspaces from java_export.

I am also working on a patch that upgrades Closure Compiler to Bazel 8 and uses latest versions of rules_jvm_external and google_bazel_common and I can confirm that problem still exists and unfortunately existing workaround doesn't work anymore since google_bazel_common generated targets show rules_jvm_external as workspace now:

DEBUG: /private/var/tmp/_bazel_goktug/XXXX/external/rules_jvm_external+/private/rules/maven_project_jar.bzl:27:14: rules_jvm_external <generated file external/rules_jvm_external++maven+google_bazel_common_maven/javax/annotation/jsr250-api/1.0/processed_jsr250-api-1.0.jar>
DEBUG: /private/var/tmp/_bazel_goktug/XXXX/external/rules_jvm_external+/private/rules/maven_project_jar.bzl:27:14: rules_jvm_external <generated file external/rules_jvm_external++maven+google_bazel_common_maven/com/google/auto/value/auto-value-annotations/1.11.0/processed_auto-value-annotations-1.11.0.jar>

I'm switching to a different workaround to use deploy_env attribute but I thought the issue is worthwhile reporting.

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

No branches or pull requests

1 participant