Setup > Maven Plugin

Ekstazi is available from Maven central. We also provide documentation if one wants to install Ekstazi plugin from binaries.

  1. Maven Central
  2. Maven Central (prior to 4.4.0)
  3. Installing from Binaries
  4. Optional Parameters

1. Maven Central

The Ekstazi Maven plugin provides support to integrate Ekstazi with Maven Surefire plugin. The recommended basic configuration is as follows.

<project>
  ...
  <build>
    ...
    <plugins>
      ...
      <plugin>
        <groupId>org.ekstazi</groupId>
        <artifactId>ekstazi-maven-plugin</artifactId>
        <version>5.3.0</version> 
        <executions>
          <execution>
            <id>ekstazi</id>
            <goals>
              <goal>select</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>

This configuration will always run tests with Ekstazi.

Goals

In some cases Ekstazi should not run whenever the tests are run. In such cases, one can simply include Ekstazi plugin (without <executions> tag) in the configuration and use the following goals to run tests with Ekstazi and cleans dependencies.

GoalDescription
ekstazi:ekstazi Select and run tests
ekstazi:clean Clean previously collected dependencies

2. Maven Central (prior to 4.4.0)

New Ekstazi is backward compatible, so you need not update your configurations if you switch to newer Ekstazi.

Prior to Ekstazi 4.4.0, the integration was slightly more complex. It included three steps. Add Ekstazi plugin in the list of "<plugins>":

<project>
  ...
  <build>
    ...
    <plugins>
      ...
      <plugin>
        <groupId>org.ekstazi</groupId>
        <artifactId>ekstazi-maven-plugin</artifactId>
        <version>4.4.0</version>
        <executions>
          <execution>
            <id>ekstazi</id>
            <goals>
              <goal>select</goal>
              <goal>restore</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>

Declare "excludesFile" parameter in Surefire plugin. Although the filename used in the <excludesFile> can be arbitrarily chosen, the path has to be absolute in the case of mulitple module; see the following below. See this page for system requirements. (Ekstazi uses "excludesFile" to pass the excludes list to Surefire plugin.)

<excludesFile>${java.io.tmpdir}/${user.name}EkstaziExcludes</excludesFile>

If your configuration passes custom arguments to Surefire (using <argLine>), please prepend "${argLine}".

<argLine>${argLine} -your -arguments</argLine>

For projects which have multiple modules, Ekstazi plugin might have to be added to the configuration file in each module.

3. Installing from Binaries

We strongly recommend that you use Ekstazi plugin from Maven central. However, if there is a need to install the plugin manually, the setup is described below.

You can install Ekstazi Maven plugin from binaries by executing the following commands:

version=5.3.0 
cd /tmp
mkdir -p ekstazi-download
cd ekstazi-download
wget -q http://ekstazi.org/release/org.ekstazi.core-${version}.jar
wget -q http://ekstazi.org/release/ekstazi-maven-plugin-${version}.jar

mvn install:install-file \
        -Dfile=org.ekstazi.core-${version}.jar \
        -DgroupId=org.ekstazi \
        -DartifactId=org.ekstazi.core \
        -Dversion=${version} \
        -Dpackaging=jar \
        -DlocalRepositoryPath=$HOME/.m2/repository/

mvn install:install-file \
        -Dfile=ekstazi-maven-plugin-${version}.jar \
        -DgroupId=org.ekstazi \
        -DartifactId=ekstazi-maven-plugin \
        -Dversion=${version} \
        -Dpackaging=jar \
        -DlocalRepositoryPath=$HOME/.m2/repository/

Some changes to pom.xml differ from the changes that are needed if one uses Ekstazi plugin from Maven central.

<dependencies>
  ...
  <dependency>
    <groupId>org.ekstazi</groupId>
    <artifactId>ekstazi-maven-plugin</artifactId>
    <version>5.3.0</version> 
  </dependency>
</dependencies>
<project>
  ...
  <build>
    ...
    <plugins>
      ...
      <plugin>
        <dependencies>
          <dependency>
            <groupId>org.ekstazi</groupId>
            <artifactId>org.ekstazi.core</artifactId>
            <version>5.3.0</version> 
          </dependency>
        </dependencies>

        <groupId>org.ekstazi</groupId>
        <artifactId>ekstazi-maven-plugin</artifactId>
        <version>5.3.0</version> 
        <executions>
          <execution>
            <id>ekstazi</id>
            <goals>
              <goal>select</goal>
              <goal>restore</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>

4. Optional Parameters

ParameterPropertyDescriptionSinceDefault
forceall ekstazi.forceall If true, all tests are forced to run and dependencies are collected 4.3.0 false
forcefailing ekstazi.forcefailing If true, tests that were failing in their latest runs will be run even if not affected by changes 4.1.0 false
parentdir ekstazi.parentdir Parent directory of .ekstazi directory 4.5.0 current working directory/${basedir} for Maven
skipme ekstazi.skipme If true, tests will run without Ekstazi 4.1.0 false