之前的博文里曾使用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>

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>

Compile Groovy/Spock with GMavenPlus的更多相关文章

  1. Compile groovy mixed with java in Maven

    Assuming that groovy codes are in src/main/groovy and java codes are in src/main/java. We can use 2 ...

  2. 使用Groovy+Spock轻松写出更简洁的单测

    当无法避免做一件事时,那就让它变得更简单. 概述 单测是规范的软件开发流程中的必不可少的环节之一.再伟大的程序员也难以避免自己不犯错,不写出有BUG的程序.单测就是用来检测BUG的.Java阵营中,J ...

  3. 使用Groovy+Spock构建可配置的订单搜索接口测试用例集

    概述 测试是软件成功上线的安全网.基本的测试包含单元测试.接口测试.在 "使用Groovy+Spock轻松写出更简洁的单测" 一文中已经讨论了使用GroovySpock编写简洁的单 ...

  4. Error:Cannot compile Groovy files: no Groovy library is defined for module 'xxxx' 错误处理

    出现 Error:Cannot compile Groovy files: no Groovy library is defined for module 'xxxx' 只要在 project str ...

  5. Groovy/Spock 测试导论

    Groovy/Spock 测试导论 原文 http://java.dzone.com/articles/intro-so-groovyspock-testing 翻译 hxfirefox 测试对于软件 ...

  6. Groovy+Spock单元测试

    一.导入依赖 Spock是基于JUnit的单测框架,提供一些更好的语法,结合Groovy语言,可以写出更为简洁的单测. <!-- groovy依赖 --> <dependency&g ...

  7. Groovy Spock环境的安装

    听说spock是一个加强版的Junit,今天特地安装了,再把过程给大家分享一下. 首先说明,我的Java项目是用maven管理的. 我用的Eclipse是Kelper,开普勒. 要使用Spock之前, ...

  8. [每日一学]apache camel|BDD方式开发apache camel|Groovy|Spock

    开发apache camel应用,最好的方式就是tdd,因为camel的每个组件都是相互独立并可测试的. 现在有很多好的测试框架,用groovy的Spock框架的BDD(行为测试驱动)是比较优秀和好用 ...

  9. [编译原理]用BDD方式开发lisp解释器(编译器)|开发语言java|Groovy|Spock

    lisp是一门简单又强大的语言,其语法极其简单: (+ 1 2 ) 上面的意思 是:+是方法或函数,1 ,2 是参数,fn=1+2,即对1,2进行相加求值,结果是:3 双括号用来提醒解释器开始和结束. ...

随机推荐

  1. sqlserver三种数据集合运算

    2.1   并集运算(UNION) (1)UNION ALL(不删除重复行) Code: 1 SELECT empID,empName,position,degree 2 FROM Employees ...

  2. Linux hostname主机名配置文件与文件 /etc/hosts解析(copy来的,原作者看到了别打我)

    1.关于/etc/host,主机名和IP配置文件 Hosts - The static table lookup for host name(主机名查询静态表) hosts文件是Linux系统中一个负 ...

  3. Redis中redis.conf里面配置详解

    是否将redis设置为守护程序,默认为no daemonize yes   如果设置为守护程序,需要指定pid文件 pidfile /var/run/redis/redis-server.pid   ...

  4. msyql中子查询IN,EXISTS,ANY,ALL,SOME,UNION介绍

    1.ANY关键字 假设any内部的查询语句返回的结果个数是三个,如:result1,result2,result3,那么, select ...from ... where a > any(.. ...

  5. understand的安装

    1.win7 64位下安装 1)下载Understand.4.0.908.x64.rar. 2)解压之,直接运行里面的Understand-4.0.908-Windows-64bit.exe. 3)选 ...

  6. quartz.net结合Topshelf实现windows service服务托管的作业调度框架

    topshelf可以很简单方便的实现windows service服务,详见我的一篇博客的介绍 http://www.cnblogs.com/xiaopotian/articles/5428361.h ...

  7. ubuntu-server部署php+mysql运行环境

    1.apt-get install git php5 mysql-server apache2 phpmyadmin 2.sudo ln -s /usr/share/phpmyadmin /var/w ...

  8. ThinkPhp 生成静态页面

    //开启静态缓存'HTML_CACHE_ON' => true, //开启缓存'HTML_CACHE_TIME' =>60, //开启缓存时间'HTML_FILE_SUFFIX' => ...

  9. lshw查看系统硬件信息

    lshw(Hardware Lister)是另外一个可以查看硬件信息的工具,不仅如此,它还可以用来做一些硬件的benchmark. lshw is a small tool to extract de ...

  10. 一款基于uploadify扩展的多文件上传插件,完全适用于Html5

    http://www.uploadify.com/documentation/  官网里面有两个插件,一个是要使用flash插件才能文件上传的插件,另外一个是不需要使用要flash插件的文件上传插件完 ...