There are a bunch of questions related to the issue that mvn test doesn't execute test classes where the answer is always, that maven-surefire looks for certain prefixes or postfixes of filenames. I already considered this and it didn't help me as my filenames where already valid.
When I execute mvn test
, the log contains the following section:
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ compiler --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 5 source files to /project_path/target/test-classes
... so mvn test
does actually find my test cases, and indeed, I can find all the compiled test classes in the directory /project_path/target/test-classes/
But still, only one of these 5 test files is actually executed and its tests are run whereas the other 4 are ignored by mvn test
.
Any ideas why that could be the case? I am not really sure which additional information could be helpful to answer this question. Just ping me if there is something that I need to add to the question.