lundi 22 octobre 2018

Maven: How to handle local files on sub projects for tests

I have a Maven project with sub projects. I added a test to one of the sub projects which uses a file from it's test resources and works fine using:

new File("target/coverage/report");

It works fine but when running the tests from the parent project it fails failing to find some files. I assume it's looking at the root of the parent folder instead.

Is there a way to handle this so it works on both scenarios?

Aucun commentaire:

Enregistrer un commentaire