Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit

Features can now imply or be implied by other features.
Implied features are executed as long as at least one implying feature is executed,
preventing their removal from the execution plan, through things such as `PostDiscoveryFilters`.
Implying features does not affect the execution order in any way.

Git stats


Failed to load latest commit information.
Latest commit message
Commit time

License Maven Central GitHub Workflow Status (branch) Jitpack Codecov Gitter Revved up by Gradle Enterprise

spock main logo

Spock Framework

Spock is a BDD-style developer testing and specification framework for Java and Groovy applications.To learn more about Spock, visit run a sample spec in your browser use the Groovy Web Console.

Latest Versions

  • The latest 2.x release version is 2.4-M1 (2.4-M1-groovy-2.5, 2.4-M1-groovy-3.0, 2.4-M1-groovy-4.0), released on 2022-30-11.

  • The current development version is 2.4-SNAPSHOT (2.4-groovy-2.5-SNAPSHOT, 2.4-groovy-3.0-SNAPSHOT, , 2.4-groovy-4.0-SNAPSHOT).

NOTE: Spock 2.x is based on the JUnit 5 Platform and require Java 8+/groovy-2.5+ (Groovy 3.0 or 4.0 is recommended, especially in projects using Java 12+).

Releases are available from Maven Central. Development snapshots are available from Sonatype OSS.

Ad-Hoc Intermediate Releases

For intermediate stable builds we recommend to use Jitpack (go here for instructions):

  1. Add as a repository

  2. Use org.spockframework.spock as groupId and the normal artifact-id

repositories {
    // ...
    maven { url '' }

dependencies {
    testImplementation 'org.spockframework.spock:spock-core:spock-2.4-M1'
    testImplementation 'org.spockframework.spock:spock-spring:spock-2.4-M1'
  1. For intermediate releases you can also use the commit-hash as version, e.g. compile com.github.spockframework.spock:spock-core:d91bf785a1


  • spock-core — Core framework. This is the only mandatory module.

  • spock-specs — Specifications for spock-core, implemented using Spock. Not required for using Spock.

  • spock-spring — Integration with the Spring TestContext Framework.

  • spock-tapestry — Integration with the Tapestry 5 IoC container.

  • spock-guice — Integration with Guice 2/3.

  • spock-unitils — Integration with Unitils.



Spock needs both a JDK 8 and JDK 17+ installed.

  • JDK 8 is required to compile Spock via toolchains (automatic download is disabled).

  • The gradle build itself requires at least JDK 17 to run.

JDK locations must be made known to toolchains via JDK<version>=<PATH> environment variable, e.g., JDK8=/path/to/jdk8.

Supported versions

Spock is supported for Java version 8+.

Spock is supported for Groovy versions 2.5, 3.0, and 4.0.

The tests are testing Spock with the specific versions (variants) of Groovy and Java. Default Groovy version is 2.5.

The Groovy 3.0 and 4.0 variant should pass on all supported JDK versions, Groovy 2.5 does not work with Java 17+:

./gradlew build

To build a specific variant of Spock, use the variant name as a parameter

./gradlew build -Dvariant=4.0

To test against a specific Java version, use the java version name as a parameter, the path to the Java version must be set via an environment variable JDK<version>=<PATH>. Of course, this can combined with the variant selection from above.

./gradlew build -DjavaVersion=17

(Windows: gradlew build). All build dependencies, including the build tool itself, will be downloaded automatically (unless already present).


Contributions are welcome! Please see the contributing page for detailed instructions.


If you have any comments or questions, please direct them to the user forum. All feedback is appreciated!

Java 9 Module Names

All published jars (beginning with Spock 1.2) will contain Automatic-Module-Name manifest attribute. This allows for Spock to be used in a Java 9 Module Path.

  • spock-core — org.spockframework.core

  • spock-spring — org.spockframework.spring

  • spock-tapestry — org.spockframework.tapestry

  • spock-guice — org.spockframework.guice

  • spock-unitils — org.spockframework.unitils

So module authors can use well known module names for the spock modules, e.g. something like this:

open module {
  requires org.spockframework.core;
  requires org.spockframework.spring;

The Spock Logo, created by created Ayşe Altınsoy (@AltinsoyAyse), is managed in the spock-logo repository.

🖖 Live Long And Prosper!

The Spock Framework Team