Is there a way to run tests with Maven, without copying all my test resources to the target directory?
We have over 800 MB of 开发者_高级运维test case resource files that are Excel format. Every time I run the mvn clean test
command, they get re-copied to the target directory, and this takes about 5 minutes on my machine.
Is there a way to setup Maven (ideally via our pom.xml
) so that it will NOT copy our testResources
to the target directory, instead using them directly from src/test/resources
?
The easiest is to put your large test resources in a separate module which is built once and then imported as a dependency using the test
scope.
In this case you must add the resources to the src/main/resources
instead of src/test/resources
in order to be able to load them.
精彩评论