maven :: run only single test in multi-module project

后端 未结 3 948
忘掉有多难
忘掉有多难 2021-01-30 03:39

Is there any way to provide some command-line argument in order to skip all tests but one on some module? So I will not need to change pom.xml every time I will need to run anot

3条回答
  •  温柔的废话
    2021-01-30 04:15

    I assume you've read the docs about running a single test under surefire? What they don't tell you is how to do that in a sub-module:

    mvn test -Dtest=testname -pl subproject
    

    Where subproject is the project containing that test. From the mvn man page:

    -pl,--projects arg Comma-delimited list of specified reactor projects to build instead of all projects. A project can be specified by [groupId]:artifactId or by its relative path.

提交回复
热议问题