Running groovy tests with Maven

前端 未结 1 1707
名媛妹妹
名媛妹妹 2020-12-20 19:06

I have a folder structure as below

ProjectName 
  - src
       - test 
             - groovy
             - java      

When I run command

相关标签:
1条回答
  • 2020-12-20 19:53

    You will need to use gmaven plugin to trigger groovy tests

    <plugin>
      <groupId>org.codehaus.groovy.maven</groupId>
      <artifactId>gmaven-plugin</artifactId>
      <version>1.0-rc-3</version>
      <extensions>true</extensions>
      <executions>
        <execution>
          <goals>
            <goal>testCompile</goal>
          </goals>
          <configuration>
            <sources>
              <fileset>
                <directory>${pom.basedir}/src/test/java</directory>
                <includes>
                  <include>**/*.groovy</include>
                </includes>
              </fileset>
            </sources>
          </configuration>
        </execution>
      </executions>
    </plugin>
    

    Nice article about running Groovy tests in Maven. The structure should be

    <project>
      ...
      <build>
        <plugins>
          <plugin>
           ....
          </plugin>
        </plugins>
      </build>
      ...
    </project>
    
    0 讨论(0)
提交回复
热议问题