We have test dependency files in src/test/resources
per the Maven Standard Directory Layout. These test files end up in the JAR and on the classpath when test c
Yes, that is the recommended approach. As mentioned in the docs for resources, Bazel understands the Maven Standard Directory Layout and will put the data files at the right classpath:
The location of the resources inside of the jar file is determined by the project structure. Bazel first looks for Maven's standard directory layout, (a "src" directory followed by a "resources" directory grandchild).
If you wanted to bundle the resource separately, you could create a resources-only jar and then depend on it with the resource_jars attribute.
Edit: as Ittai points out below, Bazel will not introspect resources, so you'd have to be careful not to end up with any collisions (e.g., pkg1/src/main/resources/foo and pkg2/src/main/resources/foo). Neither resources
not resource_jars
will check this for you, so if this is a concern, you might want to put any resources you need in a filegroup and have a genrule target or test that checks for collisions.