【Groovy】Spock with Maven
已经在项目里使用Groovy/Spock做测试框架了,感觉和Maven结合在一起还是挺好用的。
在Maven的pom.xml里引入他们还是挺方便的,第一先要在dependency 里引入
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>1.8.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.spockframework</groupId>
<artifactId>spock-core</artifactId>
<version>0.6-groovy-1.8</version>
<scope>test</scope>
</dependency>
接着是要在Plugin部分做些配置
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>test-compile</id>
<phase>test-compile</phase>
<configuration>
<tasks>
<taskdef classname="org.codehaus.groovy.ant.Groovyc" name="groovyc">
<classpath refid="maven.test.classpath"/>
</taskdef>
<mkdir dir="${project.build.outputDirectory}"/>
<mkdir dir="${project.build.testOutputDirectory}"/>
<groovyc destdir="${project.build.testOutputDirectory}" listfiles="true" srcdir="${basedir}">
<classpath refid="maven.test.classpath"/>
</groovyc> <ant antfile="${basedir}/build.xml" target="groovytarget"> </ant>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>ant</groupId>
<artifactId>ant-nodeps</artifactId>
<version>1.6.5</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.spockframework</groupId>
<artifactId>spock-maven</artifactId>
<version>0.6-groovy-1.8</version>
<executions>
<execution>
<goals>
<goal>find-specs</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.gmaven</groupId>
<artifactId>gmaven-plugin</artifactId>
<version>1.3</version>
<executions> <execution>
<goals>
<!--
<goal>generateStubs</goal>
<goal>compile</goal>
-->
<goal>generateTestStubs</goal>
<goal>testCompile</goal>
</goals> <configuration>
<debug>true</debug>
<verbose>true</verbose>
<stacktrace>true</stacktrace>
<defaultScriptExtension>.groovy</defaultScriptExtension>
<providerSelection>1.7</providerSelection>
<source>
<fileset>
<directory>${pom.dir}</directory>
<includes>
<include>**/groovy/*.groovy</include>
</includes>
</fileset> </source>
</configuration>
</execution> </executions>
</plugin>
</plugins>
</build>
【Groovy】Spock with Maven的更多相关文章
- 【Tool】IDEA配置Maven依赖管理
IDEA配置Maven 打开IDEA,在项目界面打开[File] — [Settings] 找到构建工具,下面第一个就是Maven 主选项更换我们自己的主目录和设置目录与本地仓库 勾选[打印异常捕获信 ...
- 【Tool】Windows系统安装Maven依赖管理工具
安装Maven依赖管理工具 官网下载地址:http://maven.apache.org/download.cgi 系统环境要求: [JDK]Maven3.3版本+需要JDK1.7版本以上支持 [内存 ...
- Groovy(java)+Spock+IDEA+maven+Jenkins+SVN+maven-surefire-plugin+maven-surefire-report-plugin/maven-antrun-extended-plugin集成接口测试框架
文章为原创,未经本人授权禁止转载. 一.spock框架环境搭建. 二.基于spock框架的脚本开发. 三.基于spock框架的用例执行并生成HTML报告. 四.集成jenkins生成HTML报告. 五 ...
- 【SSM】Eclipse使用Maven创建Web项目+整合SSM框架
自己接触ssm框架有一段时间了,从最早的接触新版ITOO项目的(SSM/H+Dobbu zk),再到自己近期来学习到的<淘淘商城>一个ssm框架的电商项目.用过,但是还真的没有自己搭建过, ...
- 【转】Myeclipse建立Maven项目
原文地址: http://b-l-east.iteye.com/blog/1246482 1. 使用Maven创建webapp工程----原因是使用Maven时一般需要遵循一定的目录结构,虽然也可以使 ...
- 【Jersey】IntelliJ IDEA + Maven + Jetty + Jersey搭建RESTful服务
本文参考以下内容: 使用Jersey实现RESTful风格的webservice(一) Starting out with Jersey & Apache Tomcat using Intel ...
- 【转】idea 用maven骨架生成项目速度慢的问题
转自:http://9leg.com/maven/2015/02/01/why-is-mvn-archetype-generate-so-low.html 最近从IntelliJ Idea 14的Co ...
- 【Groovy】入门布道ppt
Groovy Outline• Hello world• Smooth Java integration• Flat learning curve• Powerful features 跟 Java ...
- 【转载】如何用Maven创建web项目(具体步骤)
使用eclipse插件创建一个web project 首先创建一个Maven的Project如下图 我们勾选上Create a simple project (不使用骨架) 这里的Packing 选择 ...
随机推荐
- 问题:oracle 计算年龄;结果:oracle中根据生日计算年龄的问题
SELECT FLOOR(MONTHS_BETWEEN(SYSDATE,birthday)/12,1) FROM ltteacherinfo where name='朱雪东111'这个报错ORA 00 ...
- spirngmvc整合mybatis实现CRUD
一.建立一张简单的User表 CREATE TABLE `users` ( `id` ) NOT NULL AUTO_INCREMENT, `name` ) NOT NULL, `age` ) DEF ...
- eclipse 中文版 变成 英文版 方法
找到目录运行命令 “eclipse.exe -nl en”
- SharedPreferences 用法
private void getUserInfoFromPref(){ /* * 保存到文件的方法 * * Constant.user = (User)Constant.readObjectFromF ...
- MSSQL 日期查询 包含NULL值
方一: 以下做法保证数据里面没有NULL值 '') '') '') '') exec sp_executesql N'select ide_code as ''系统编号'',name as ''申请专 ...
- php中定义数组的方法
1.PHP定义数组的格式 数组名=array(); 如:$aa=array();//这样就定义了一个数组, 之后给元素赋值: $aa[0]="9016"; $aa[1]=" ...
- cocos2d-js 定时器
1.scheduleUpdate 节点中有scheduleUpdate接口,通过这个接口,可以让游戏在每帧执行都执行update方法 var ScheduleUpdateLayer = cc.Laye ...
- 一个典型的PHP分页实例代码
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- 【Boost】boost库中timer定时器 2
博客转载自:http://blog.csdn.net/yockie/article/details/40386145 先跟着boost文档中asio章节的指南中的几个例子学习一下使用: 所有的Asio ...
- opencv中读写视频
1.介绍 OpenCV 读写视频之前,先介绍一下编解码器(codec) .如果是图像文件, 我们可以根据文件扩展名得知图像的格式.但是此经验并不能推广到视频文件中. 有些 OpenCV 用户会碰到奇怪 ...