Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[m2e-users] Is there a way for a JUnit test to trigger the generate-test-sources phase in m2e?

I have a JUnit test that tests that some files in a directory has been
deleted.

The directory where the test does the deletion is in the
target/test-classes/repository directory, and this directory is copied
from the src/test/resources/repository directory by maven defaults.

Running "mvn clean install" works fine.  Running "mvn install" also
works fine.

However, in eclipse with m2e, the tests only run fine the first time
after something has triggered resource regeneration.  

"Something to trigger resource regeneration" is typically editing a
file.

Is there a way to trigger resource generation from a JUnit test setup?

Or would I be better off making sure the files are copied in the test
setup? (ie. the simple, straightforward, solution)

(it feels wrong to manually do the job that maven already does so well,
and it also feels wrong to copy files were maven already copy the files,
ie. do the work twice when running from the mvn command line)

Thanks!



- Steinar



Back to the top