Maven won't run tests

后端 未结 1 730
说谎
说谎 2021-02-08 13:16

When running mvn test maven won\'t run all Test Classes. When I explicitly provide a class by adding -Dtest=PropertyTests the tests will be run.

<
1条回答
  •  無奈伤痛
    2021-02-08 13:25

    You need to add the maven surefire plugin to run the tests. The configuration can be found here.

    Here's a configuration that I've been using with specs/junit.

    
        org.apache.maven.plugins
        maven-surefire-plugin
        2.8.1
        
            
                **/*Spec.*
                **/*Test.*
            
        
    
    

    The naming convention is Test, so change PropertyTests to PropertyTest.

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