Skip to content
This repository was archived by the owner on Jul 2, 2026. It is now read-only.
This repository was archived by the owner on Jul 2, 2026. It is now read-only.

"Folder ... contains more Java files then configured in Bazel" when file is used in a java_library package. #116

Open

Description

@toumorokoshi

I'm getting this error when running the extension on bazel itself:

Folder '/home/yusuke.tsutsumi/workspace/bazel/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac' contains more Java files then configured in Bazel. This is a scenario which is challenging to support in IDEs! Consider re-structuring your source code into separate folder hierarchies and Bazel packages.
 - javac/JavacOptions.java
 - javac/WerrorCustomOption.java

I looked at the files, and those are used in a separate target, although indeed they are explicitly excluded from the javac target

Although I think the error is still correct in that the package structure is difficult for parse properly - it is still a technically correct usage of bazel.

At minimum maybe this should be a warning and not an error?

Activity

  1. changed the title [-]Folder ... contains more Java files then configured in Bazel when file is used in a java_library package.[/-] [+]"Folder ... contains more Java files then configured in Bazel" when file is used in a java_library package.[/+] on Apr 17, 2024
  2. guw commented on Apr 17, 2024

    @guw
    Contributor

    Are you using the project-per-package strategy?

  3. toumorokoshi commented on Apr 17, 2024

    @toumorokoshi
    Author

    I don't believe so - is there a way I can confirm that?

  4. guw commented on Apr 17, 2024

    @guw
    Contributor

    If you haven't set it then it's defaulting to project-per-target and the error is indeed a bug. It should be a warning level in this setup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions