Why does maven keep resources in a separate "source folder" from the Java sources?
From my experience, in Java the resource files are mostly treated like Java source files which, when "compiled", just need to be copied as-is with the classes, and eventually packaged in the jar, and accessed by the classloader's methods getResource
/getResourceAsStream
, via the classpath
.
Personally I find it a useless complexity to keep resource files separate from Java sources.
- What do you think?
- Is there a good reason why maven keeps resources separate from sources?
- Is there any counter indication in not using
src/main/resources
andsrc/test/resources
and keeping resources insrc/main/java
andsrc/test/java
using maven?