为什么maven-surefire-plugin会在我的集成测试中运行

时间:2017-04-24 02:22:03

标签: maven testing maven-surefire-plugin

我看到surefire插件在我的集成测试中运行是很奇怪的。谁知道为什么?

[INFO] --- maven-surefire-plugin:2.17:test (default-test) @ xxxx ---
[INFO] Surefire report directory: /Users/jzhang/github/project/module-A/target/surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running package.XXXXIT

1 个答案:

答案 0 :(得分:3)

是。这很自然。您需要告诉maven-surefire-plugin跳过以* IT.java结尾的测试的执行。

<build> 
<plugins> 
   <plugin>          
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-surefire-plugin</artifactId>
       <version>2.20</version>    
       <configuration>
            <excludes>    
                  <exclude>**/*IT.java</exclude> 
            </excludes> 
       </configuration> 
   </plugin>
</plugins>       
</build>