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

前端 未结 3 597
慢半拍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:49

    Let me extend Sean's answer. This is what you set in pom.xml:

    
      nothing-to-exclude
    
    
      
        fast
        
          **/*Dao*.java
        
      
    
    
      org.apache.maven.plugins
      maven-surefire-plugin
      
        
         ${exclude.tests}
        
      
    
    

    Then in CI you start them like this:

    mvn -Pfast test
    

    That's it.

提交回复
热议问题