Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
我可以在maven surefire插件中使用Group和ExcludedGroup吗?_Maven_Junit_Categories_Surefire - Fatal编程技术网

我可以在maven surefire插件中使用Group和ExcludedGroup吗?

我可以在maven surefire插件中使用Group和ExcludedGroup吗?,maven,junit,categories,surefire,Maven,Junit,Categories,Surefire,我可以用一个类别注释一个测试类以供包含,然后用另一个类别注释某些测试方法以供排除吗 我尝试了以下方法,但它只是使用组来包含测试类。然后surefire甚至不考虑测试类中带有“excludedGroups”注释的方法 <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <executions> <

我可以用一个类别注释一个测试类以供包含,然后用另一个类别注释某些测试方法以供排除吗

我尝试了以下方法,但它只是使用组来包含测试类。然后surefire甚至不考虑测试类中带有“excludedGroups”注释的方法

<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<executions>
    <execution>
        <id>surefire-integration-tests</id>
        <phase>test</phase>
        <configuration>
            <!-- Include these classes -->
            <groups>my.test.category.IncludeTheseClasses</groups>
            <!-- Exclude these test methods -->
            <excludedGroups>my.test.category.IgnoreTheseMethods</excludedGroups>
        </configuration>
    </execution>
org.apache.maven.plugins
maven surefire插件
surefire集成测试
测试
my.test.category.IncludeTheseClasses
my.test.category.ignore这些方法
并包含标记,而不是类

<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<executions>
    <execution>
        <id>surefire-integration-tests</id>
        <phase>test</phase>
        <configuration>
            <!-- Include these classes -->
            <groups>my.test.category.IncludeTheseClasses</groups>
            <!-- Exclude these test methods -->
            <excludedGroups>my.test.category.IgnoreTheseMethods</excludedGroups>
        </configuration>
    </execution>