JPMS: Cannot use both annotations and type-annotations
I'm trying to use both @Immutable and @ImmutableTypeParameter in a JPMS project. However, using annotations from both error_prone_annotations and error_prone_type_annotations doesn't work because they both export the same package.
module test.foo {
requires com.google.errorprone.annotations;
requires com.google.errorprone.type.annotations;
}
Compilation fails with:
[ERROR] module test.foo reads package com.google.errorprone.annotations from both com.google.errorprone.type.annotations and com.google.errorprone.annotations
Is there a path to supporting all available annotations with JPMS?
I pushed a release that merges error_prone_type_annotations into error_prone_annotations, so it should be possible to just depend on error_prone_annotations to avoid the split package issue: https://github.com/google/error-prone/releases/tag/v2.37.0
Stumbled on an issue where error_prone_annotations still depends on the now removed error_prone_type_annotations, here's a PR to remove that: https://github.com/google/error-prone/pull/4924
This is by-design (https://github.com/google/error-prone/commit/04fe8357e885ff17990b0558379bbe158397b23c)
Shouldn't this be fixed in Bazel's rules_jvm_external to properly handle relocations?
Shouldn't this be fixed in Bazel's rules_jvm_external to properly handle relocations?
That's fair. It does somewhat handle relocations (https://github.com/bazel-contrib/rules_jvm_external/tree/d8af22108bd8b353a226140570008231f2921931?tab=readme-ov-file#overriding-generated-targets), but doesn't seem to handle the case where relocation target depend on the relocated artifact.