码迷,mamicode.com
首页 > 其他好文 > 详细

Compile Groovy/Spock with GMavenPlus

时间:2016-05-21 20:19:48      阅读:185      评论:0      收藏:0      [点我收藏+]

标签:

之前的博文里曾使用GMaven插件编译Groovy/Spock,这次使用GMavenplus插件,更加方便。

具体步骤

1. 导入Spock和Groovy依赖

<dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy-all</artifactId>
            <version>2.4.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.spockframework</groupId>
            <artifactId>spock-core</artifactId>
            <version>1.0-groovy-2.4</version>
            <scope>test</scope>
        </dependency>
        <!-- http://mvnrepository.com/artifact/org.spockframework/spock-spring -->
        <dependency>
            <groupId>org.spockframework</groupId>
            <artifactId>spock-spring</artifactId>
            <version>1.0-groovy-2.4</version>
        </dependency>

 

2.配置GMavenPlus

技术分享
<plugin>
                <groupId>org.codehaus.gmavenplus</groupId>
                <artifactId>gmavenplus-plugin</artifactId>
                <version>1.4</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>compile</goal>
                            <goal>testCompile</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
View Code

 

3.配置surefire plugin

技术分享
 <plugin>
                <artifactId>maven-surefire-plugin</artifactId>

                <configuration>
                    <testFailureIgnore>false</testFailureIgnore>
                    <includes>
                        <include>**/*Spec.java</include>
                        <!-- Yes, .java extension -->
                        <include>**/*Test.java</include>
                        <!-- Just in case of having also "normal" JUnit tests -->
                    </includes>
                </configuration>
            </plugin>
View Code

 

Compile Groovy/Spock with GMavenPlus

标签:

原文地址:http://www.cnblogs.com/buhaiqing/p/5515371.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!