If you place some files in /src/main/resources
they will be placed on the CLASSPATH in the target JAR artifact. This means if you depend on such an artifact, you will have access to all resources, just as you have access to classes in it.
<dependency>
<groupId>com.example.foo</groupId>
<artifactId>my-resources</artifactId>
<version>0.1</version>
</dependency>
If my-resources
artifact contains some resources in /src/main/resources
, you can access them at runtime just like you (or any other library) can access /src/main/resources
contents from the same artifact.
Note that this won't work with /src/test/resources
because test resources are only placed on CLASSPATH during surefire
execution of current artifact.