I have a project that uses the normal Maven structure, e.g.
module
\\ src
\\ main
- java
- resources
\\ test
- java
- resources
Try this?
1)put test data files into the same package structure as you test classes. That is, if you have a test class named Apple in src/test/java/com/fruits, you test data file will be in src/resources/java/com/fruits.
2) When the files are compiled both the class and the data file should be in target/test-classes/com/fruits. If this is the case, in you code, you can obtain the file this way "this.getClass().getResourceAsStream("myFile")"