Maven Surefire插件;包括「;Groovy源代码的选项

Maven Surefire插件;包括「;Groovy源代码的选项,maven,groovy,maven-surefire-plugin,Maven,Groovy,Maven Surefire Plugin,我有Groovy项目,我想通过Surefire控制要执行哪些测试() 假设我有testExampleTest,我可以如下配置Surefire: <plugin> <artifactId>maven-surefire-plugin</artifactId> <version>2.19</version> <configuration> <includes>

我有Groovy项目,我想通过Surefire控制要执行哪些测试()

假设我有test
ExampleTest
,我可以如下配置Surefire:

<plugin>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>2.19</version>
    <configuration>
        <includes>
            <include>**/ExampleTest.*</include>
        </includes>
    </configuration>
</plugin>

maven surefire插件
2.19
**/示例测试*
我还可以使用
ExampleTest.*
ExampleTest
并且可以正常工作

不幸的是,我无法将其配置为
ExampleTest.groovy
,但它适用于
ExampleTest.java


为什么会这样?它是一个bug吗?

是的,我们可以说它是一个bug。不能在包含列表中使用
.groovy
。但是,如果您使用
*
.java
.class
的话,它会起作用。我建议您在
模式中使用regex支持

例如,要包含
ExampleTest.groovy
文件:


org.apache.maven.plugins
maven surefire插件
2.19
%regex[ExampleTest\.groovy]