I have a maven project and I would like to get a list of all the test classes and their file paths, without having to execute all the tests.
After I run "mvn test", the only files that I have under target/ are
checkstyle-cachefile checkstyle-checker.xml checkstyle-result.xml maven-shared-archive-resources
I want something very general, that doesn't require me to edit the pom.xml file.
To skip running the tests for a particular project, set the skipTests property to true. You can also skip the tests via the command line by executing the following command: mvn install -DskipTests.
test. skip=true to skip the entire unit test. By default, when building project, Maven will run the entire unit tests automatically. If any unit tests is failed, it will force Maven to abort the building process. In real life, you may STILL need to build your project even some of the cases are failed.
mvn clean: Cleans the project and removes all files generated by the previous build. mvn compile: Compiles source code of the project. mvn test-compile: Compiles the test source code. mvn test: Runs tests for the project.
We can run our unit tests with Maven by using the command: mvn clean test. When we run this command at command prompt, we should see that the Maven Surefire Plugin runs our unit tests.
In my case, the test classes names were stored in
target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst
You can run mvn test-compile
to create it without running the tests.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With