You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Msg("Two `java_export` targets want to export the same dependency. This can lead to incorrect results, please disambiguate, e.g. by having export depend on other export explicitly.")
{"level":"error","label":"//other_deps/src/main/java/com/example/other_deps/plain_deps:plain_deps_export","message":"java_export rule contained a non-empty `srcs` attribute, but it will be ignored during resolution. Instead, please use the `exports` or `runtime_deps` attributes and depend on the generated `java_library`"}
2
-
{"level":"error","dependency":"//shared_dep/src/main/java/com/example/shared_dep/shared_dep","java_exports":["//shared_dep/src/main/java/com/example/shared_dep/export_one","//shared_dep/src/main/java/com/example/shared_dep/export_two"],"message":"Two `java_export` targets want to export the same dependency. This can lead to incorrect results, please disambiguate, e.g. by having export depend on other export explicitly."}
2
+
{"level":"warn","dependency":"//shared_dep/src/main/java/com/example/shared_dep/shared_dep","java_exports":["//shared_dep/src/main/java/com/example/shared_dep/export_one","//shared_dep/src/main/java/com/example/shared_dep/export_two"],"message":"Two `java_export` targets want to export the same dependency. This can lead to incorrect results, please disambiguate, e.g. by having export depend on other export explicitly."}
{"level":"warn","package":"com.idonotexist","from rule":"//src/main/java/com/example/hello","classes":["MyClass"],"message":"Unable to find package for import in any dependency"}
1
+
{"level":"error","package":"com.idonotexist","from rule":"//src/main/java/com/example/hello","classes":["MyClass"],"message":"Unable to find package for import in any dependency"}
2
2
{"level":"fatal","message":"the java extension encountered errors that will create invalid build files"}
This fixture also covers same-package class references without imports in split source roots.
5
+
`src/test/java/com/example/myproject/AppTest.java` references `App` as a bare type (`App app = ...`) with no import, which is valid because both files are in `com.example.myproject`.
6
+
7
+
`src/sample/java/com/example/myproject/SampleOnly.java` is intentionally present to create a second provider of `com.example.myproject` (in addition to `src/main`). That forces ambiguous package-level resolution and requires class-level disambiguation using `imported_classes`.
8
+
9
+
If the parser drops same-package bare type references, class-level input is missing and the test target can no longer reliably resolve to `//src/main/java/com/example/myproject` (the target that actually provides `App`). With the fix, `com.example.myproject.App` is retained and resolution succeeds.
0 commit comments