简体   繁体   English

适用于常规测试的Maven插件

[英]Maven plugin for groovy tests

I have 2 directories for tests: one for groovy and second for java. 我有两个测试目录:一个用于groovy,第二个用于java。 And I'm looking for a maven plugin for run test from a command line. 我正在寻找一个maven插件,用于从命令行进行运行测试。 I have a plugin: 我有一个插件:

<plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.7.2</version>
            <configuration>
                <includes>
                    <include>**/*Test.java</include>
                    <include>**/*Spec.groovy</include>
                </includes>
            </configuration>
        </plugin>

And it works for Java test, but when I have a not working test in groovy directory maven doesn't show a problem. 它适用于Java测试,但是当我在groovy目录中没有工作测试时maven没有显示问题。 It's a structure of my project: 这是我项目的结构:

    ├── src
│   ├── main
│   │   ├── java
│   │   └── resources
│   └── test
│       ├── groovy
│       └── java
└── target

查看官方示例存储库https://github.com/spockframework/spock-example Maven / Gradle / Ant示例。

Try adding the gmaven-plugin to your pom eg 尝试将gmaven-plugin添加到您的pom中,例如

<plugin>
   <groupId>org.codehaus.gmaven</groupId>
   <artifactId>gmaven-plugin</artifactId>
   <version>1.5</version>
   <executions>
     <execution>
       <goals>
         <goal>compile</goal>
         <goal>testCompile</goal>
       </goals>
     </execution>
   </executions>
 </plugin>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM