<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <properties>
    <thrift.gen.source>target/generated-sources</thrift.gen.source>
  </properties>

  <parent>
    <groupId>net.sf.ehcache.x-platform</groupId>
    <artifactId>x-platform-parent</artifactId>
    <version>1.0.2</version>
  </parent>

  <artifactId>thrift-java</artifactId>
  <description>
    This module will generate the classes according to the ../thrift-idl configuration
    On Mac OS X, use brew and type : brew install thrift ; to install the thrift compiler
    Then replace the thrift.exec property with something like : /usr/local/Cellar/thrift/0.9.0/bin/thrift
  </description>

  <build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>1.7</version>
        <executions>
          <execution>
            <id>add-thrift-source</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>add-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>${thrift.gen.source}</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <id>generate-sources</id>
            <phase>generate-sources</phase>
            <configuration>
              <tasks>
                <mkdir dir="${thrift.gen.source}"/>
                <exec executable="${thrift.exec}" failonerror="true">
                  <arg value="--gen"/>
                  <arg value="java:private-members,hashcode,java5"/>
                  <arg value="-out"/>
                  <arg value="${thrift.gen.source}"/>
                  <arg value="../thrift-idl/ehcache.thrift"/>
                </exec>
              </tasks>
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <dependencies>
    <dependency>
      <groupId>org.apache.thrift</groupId>
      <artifactId>libthrift</artifactId>
      <version>${thrift.lib.version}</version>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-jdk14</artifactId>
      <version>1.7.1</version>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.softwareag.nirvana</groupId>
      <artifactId>nClient</artifactId>
      <version>${nirvana.maven.version}</version>
    </dependency>
    <dependency>
      <groupId>com.softwareag.nirvana</groupId>
      <artifactId>nServer</artifactId>
      <version>${nirvana.maven.version}</version>
    </dependency>
  </dependencies>

</project>
