tags:

views:

20

answers:

1

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?

+1  A: 

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.

Peter Tillemans
+1 We do this with about 100mb of XML that is changed about 3 times a year. Besides zipping down to 14mb, it is much easier to manage. Checkout of the project is much quicker.
sal
In my case, these test files change frequently; I'd say at least 1 out of the 150+ files changes weekly, if not daily. If I were to use your approach, and a single test resource file changed, would I have to wait for ALL test files to be downloaded/updated/copied again?
Steve K
I guess I should add @Peter and @sal, cause otherwise you guys won't get notified of my comment, right? (and I don't see a way to edit my previous comment, only delete it).
Steve K
@Steve K: Sorry, I was sure I replied, maybe I forgot to press the save button. I mentioned you can create the module right next to your main module and then use the update only the differences and build and install the jar with test data locally once for every change. Then you still have the advantages on your main project.
Peter Tillemans