Call us: +1-415-738-4000
This page is intended for those who want to create their own Ehcache or distributed Ehcache build rather than use the packed kit.
These instructions work for each of the modules, except for JMS Replication, which requires installation of a message queue. See that module for details.
To build Ehcache from source:
mvn -Dmaven.test.skip=true installTo run the test suite for Ehcache:
mvn test-D net.sf.ehcache.speedAdjustmentFactor=x System property to your command line, where x is how many times your machine is slower than the reference machine. Try setting it to 5 for a start.Other modules have dependencies as specified in their maven POMs.
To include Ehcache in your project, use:
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
<version>2.3.1</version>
<type>pom</type>
</dependency>
Note: Be sure to substitute the version number above with the version number of Ehcache that you want to use.
If using Terracotta Distributed Ehcache, also add:
<dependency>
<groupId>org.terracotta</groupId>
<artifactId>terracotta-toolkit-1.4-runtime</artifactId>
<version>4.0.0</version>
</dependency>
<repositories>
<repository>
<id>terracotta-repository</id>
<url>http://www.terracotta.org/download/reflector/releases</url>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
Be sure to check the dependency versions for compatibility. Versions released in a single kit are guaranteed compatible.
With a Distributed Ehcache, there is a Terracotta Server Array. At development time, this necessitates running a server locally for integration and/or interactive testing. There are plugins for Maven and Ant to simplify and automate this process.
For Maven, Terracotta has a plugin available which makes this very simple.
<pluginRepositories>
<pluginRepository>
<id>terracotta-snapshots</id>
<url>http://www.terracotta.org/download/reflector/maven2</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
<plugin>
<groupId>org.terracotta.maven.plugins</groupId>
<artifactId>tc-maven-plugin</artifactId>
<version>1.5.1</version>
<executions>
<execution>
<id>run-integration</id>
<phase>pre-integration-test</phase>
<goals>
<goal>run-integration</goal>
</goals>
</execution>
<execution>
<id>terminate-integration</id>
<phase>post-integration-test</phase>
<goals>
<goal>terminate-integration</goal>
</goals>
</execution>
</executions>
</plugin>
Note: Be sure to substitute the version number above with the current version number.
To start Terracotta:
mvn tc:start
To stop Terracotta:
mvn tc:stop
See the Terracotta Forge for a complete reference.
