Adding Terracotta Server into your Maven build

Having servers at development time is pain. You need tooling to make it smooth. Fortunately, Terracotta has the tc-maven plugin for this purpose.

Integration Testing with Maven

To start and stop the server pre and post integration tests, add the following to your pom.xml:

<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>
 

Interactive Use

Interactively, with the pom configured, it is just mvn tc:start to start and mvn tc:stop to stop

By Greg Luck

As Terracotta’s CTO, Greg (@gregrluck) is entrusted with understanding market and technology forces and the business drivers that impact Terracotta’s product innovation and customer success. He helps shape company and technology strategy and designs many of the features in Terracotta’s products. Greg came to Terracotta on the acquisition of the popular caching project Ehcache which he founded in 2003. Prior to joining Terracotta, Greg served as Chief Architect at Australian online travel giant Wotif.com. He also served as a lead consultant for ThoughtWorks on accounts in the United States and Australia, was CIO at Virgin Blue, Tempo Services, Stamford Hotels and Resorts and Australian Resorts and spent seven years as a Chartered Accountant in KPMG’s small business and insolvency divisions. He is a regular speaker at conferences and contributor of articles to the technical press.

3 comments

  1. Pingback: ERIK
  2. Pingback: SEAN
  3. Pingback: PAUL

Comments are closed.