Is there a way to tell surefire to skip tests in a certain package?

前端 未结 3 599
慢半拍i
慢半拍i 2020-11-29 07:11

Something like the following.

I would like a way to skip my dao tests in surefire. Trying to avoid overhead of defining Suites.

With CI I\'d like to have on

3条回答
  •  温柔的废话
    2020-11-29 07:37

    Sure, no problem:

    
       org.apache.maven.plugins
       maven-surefire-plugin
       2.6
       
          
             
             **/*Dao*.java
             
             **/dao/*.java
          
       
    
    

    Reference:

    • Maven Surefire Plugin > Inclusions and Exclusions of Tests

    (The excludes can not be configured via command line, so if you want to turn this behavior on conditionally, you will have to define a profile and activate that on the command line)

提交回复
热议问题