|
AFAIK, this isn't a typo.
From the docs: maven.test.search.classdir=true I agree the code doesn't make much sense though, why is the searchdir being set to ${maven.test.dest} and then in almost all cases, being overwritten to ${pom.build.unitTestSourceDirectory} All in all, I still don't understand why the run tests are found in the tests sources. Why don't one use the compiled classes as input?
What are the drawbacks of doing so? Whatever the answer to that question, with the current implementation, I think that the doc should be improved to say at least in the sourceModifications doc to look at this maven.test.search.classdir property. Or maybe this should be added as a FAQ in the wiki. The problem is that if you use sourceModifications, then you may end up with some classes not being compiled, and running the tests based on the test source directory becomes a bad idea. And the documentation of the maven.test.search.classdir property should perhaps also mention the sourceModifications change that could result in the need for using that property. (which is to me a more frequent reason that using Groovy) |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
My problem is that I want to only run tests which have been compiled. But the sourceModifications was not taken into account. the test plugin only compiles classes which are not excluded in the sourceModifications excludes. But after that it tries to run tests based on the test source directory.
So it tried to run classes that have not been compiled.
I thought that the reason for the problem was coming from this strange property which is not referenced anywhere else.
But I may be wrong.