Works for us. Yes, it may be a bit annoying to get all the dependenices
right. We use groovy 2.0 as the base dependency (that'll drive the choice
for many other downstream dependencies..) I can't guarantee I have all the
deps listed below but should get you started. Install corresponding Groovy
Eclipse plugins (compiler, tests, m2e integration v. 2.8.0...).
Some dependencies:
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>2.0.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.gebish</groupId>
<artifactId>geb-spock</artifactId>
<version>0.9.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.spockframework</groupId>
<artifactId>spock-core</artifactId>
<version>0.7-groovy-2.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-htmlunit-driver</artifactId>
<version>2.39.0</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.2.5</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-firefox-driver</artifactId>
<version>2.39.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.detro.ghostdriver</groupId>
<artifactId>phantomjsdriver</artifactId>
<version>1.1.0</version>
<scope>test</scope>
</dependency>
Plugin configuration:
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<includes>
<include>**/*UnitTest.java</include>
</includes>
</configuration>
<!-- Spock tests need to be run in a separate execution
because Spock internally uses JUnit. Surefire allows
either testng or junit but not in the same execution -->
<execution>
<id>test-spock</id>
<phase>integration-test</phase>
<configuration>
<includes>
<include>**/*Spec*</include>
</includes>
<testNGArtifactName>none:none</testNGArtifactName>
<forkMode>once</forkMode>
</configuration>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
</plugin>
<!--
http://groovy.codehaus.org/Groovy-Eclipse+compiler+plugin+for+Maven -->
<plugin>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-compiler</artifactId>
<version>2.7.0-01</version>
<extensions>true</extensions>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-batch</artifactId>
<version>2.0.4-04</version>
</dependency>
</dependencies>
</plugin>
Kalle
On Sat, Jan 11, 2014 at 1:28 PM, Lance Java <[email protected]>wrote:
> I'm building with maven and trying to write a geb test which will run in
> eclipse.
>
> Does anyone have a pom.xml which will work in eclipse using m2e?
>
> Nothing I've found on the web seems to work.
>
> Cheers,
> Lance.
>