Skip single test with maven with command line options

后端 未结 1 1823
挽巷
挽巷 2021-02-13 22:16

I would like to skip a single test (e.g. com.example.MyTest) when building a project with Maven from the command line.

I\'m aware of similar questions like

相关标签:
1条回答
  • 2021-02-13 23:10

    It turns out that (at least in Surefire 2.19), the test pattern doesn't work with fully qualified class names. So the right solution is

    mvn clean install -Dtest="*,!MyTest"
    

    i.e. without the package path.

    In Surefire 2.19.1, it should be possible to use fully qualified names. In versions older than 2.19, neither seems to work.

    0 讨论(0)
提交回复
热议问题