My file is under project/src/test/resources/fileToBeFound.xml and src/target/test-classes/fileToBeFound.xml. In my class, I'm using
this.getClass().getProtectionDomain().getCodeSource().getLocation().getPath()
to get the relative path which is /project/target/classes. Then I convert it to /project/src/test/resources. In my local, everything is going right. but when I run the CI job, there's an IO Exception.