Maven(surefire)测试插件排除不起作用 [英] Maven (surefire) test plugin excludes not working

查看:656
本文介绍了Maven(surefire)测试插件排除不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的pom.xml中有以下配置

I have following configuration in my pom.xml

<build>
  <plugins>
      <plugin>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.17</version>
          <configuration>
              <excludes>
                  <exclude>**/DocumentChangeSubscriberTest.java</exclude>
              </excludes>
          </configuration>
      </plugin>
      (...)

DocumentChangeSubscriberTest 是一个arquillian测试,我只想在指定的配置文件中运行。
当我输入 mvn install 时,所有测试都会运行,甚至 DocumentChangeSubscriberTest 我要排除。
如何从默认(匿名)个人资料中排除测试?

DocumentChangeSubscriberTest is an arquillian test that I want to run only in specified profile. When I type mvn install all tests are run, even DocumentChangeSubscriberTest that I want to exclude. How to exclude test from the default (anonymous) profile?

我试过< includes>< include> ... 并且它运行正常 - 只运行包含的测试。

I tried <includes><include>... and it works fine - only included tests were run.

我看到 maven surefire测试插件运行测试即使它们被排除在外:但这对我不起作用。我还尝试了许多版本的 maven-surefire-plugin 而没有结果。有任何想法吗?

I saw maven surefire test plugin runs tests even if they are excluded: but this is not working for me. I also tried many versions of maven-surefire-plugin without result. Any ideas?

推荐答案

好的,排除测试工作。这就像拼写我的类名一样简单: DocumentChangeSubsriberTest.java 而不是 DocumentChangeSubscriberTest.java

Ok, excluding tests works. It was as simple as mispelling my class name: DocumentChangeSubsriberTest.java instead of DocumentChangeSubscriberTest.java.

抱歉。

这篇关于Maven(surefire)测试插件排除不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆