<?xml version="1.0"?>
<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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>net.sf.ehcache</groupId>
    <artifactId>ehcache-parent</artifactId>
    <version>2.12</version>
  </parent>

  <artifactId>ehcache-ee-root</artifactId>
  <version>2.8.3</version>
  <packaging>pom</packaging>

  <name>ehcache-ee-root</name>
  <description>Parent POM Enterprise Ehcache</description>

  <properties>
    <ehcache.os.version>${project.version}</ehcache.os.version>
    <terracotta-license.version>1.1.1</terracotta-license.version>
    <slf4j.version>1.6.6</slf4j.version>
    <offheap-store.version>1.1.6</offheap-store.version>
    <search.version>1.4.8</search.version>
    <maven-forge-plugin.version>1.2.5</maven-forge-plugin.version>
    <bigmemory.version>4.1.3</bigmemory.version>
    <security.version>1.3.17</security.version>
    <terracotta-toolkit-api-internal.version>1.11</terracotta-toolkit-api-internal.version>
    <statistics.version>1.0.1</statistics.version>
    <gmaven-plugin.version>1.4</gmaven-plugin.version>
    <surefire.version>2.15</surefire.version>
  </properties>

  <modules>
    <module>ehcache-common</module>
    <module>ehcache-offheap</module>
    <module>ehcache-core-ee</module>
    <module>terracotta</module>
    <module>ehcache-ee</module>
    <module>management-ee-ehcache-impl</module>
    <module>ehcache-ee-rest-agent</module>
  </modules>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${slf4j.version}</version>
      </dependency>
      <dependency>
        <groupId>net.sf.ehcache.internal</groupId>
        <artifactId>ehcache-core</artifactId>
        <version>${ehcache.os.version}</version>
      </dependency>
      <dependency>
        <groupId>net.sf.ehcache.internal</groupId>
        <artifactId>ehcache-terracotta-bootstrap</artifactId>
        <version>${ehcache.os.version}</version>
      </dependency>
      <dependency>
        <groupId>net.sf.ehcache</groupId>
        <artifactId>management-ehcache-impl</artifactId>
        <version>${ehcache.os.version}</version>
      </dependency>
      <dependency>
        <groupId>net.sf.ehcache.internal</groupId>
        <artifactId>ehcache-core</artifactId>
        <type>test-jar</type>
        <version>${ehcache.os.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.terracotta.license</groupId>
        <artifactId>terracotta-license</artifactId>
        <version>${terracotta-license.version}</version>
      </dependency>
      <dependency>
        <groupId>com.terracotta</groupId>
        <artifactId>security-keychain</artifactId>
        <version>${security.version}</version>
      </dependency>
      <dependency>
        <groupId>com.terracotta</groupId>
        <artifactId>security-REST</artifactId>
        <version>${security.version}</version>
      </dependency>
      <dependency>
        <groupId>org.terracotta.internal</groupId>
        <artifactId>statistics</artifactId>
        <version>${statistics.version}</version>
      </dependency>
      <dependency>
        <groupId>com.terracottatech</groupId>
        <artifactId>offheap-store</artifactId>
        <version>${offheap-store.version}</version>
      </dependency>
      <dependency>
        <groupId>com.terracottatech</groupId>
        <artifactId>search</artifactId>
        <version>${search.version}</version>
      </dependency>
      <dependency>
        <groupId>com.terracottatech</groupId>
        <artifactId>search-ee</artifactId>
        <version>${search.version}</version>
      </dependency>
      <dependency>
        <groupId>org.terracotta.toolkit</groupId>
        <artifactId>terracotta-toolkit-api-internal</artifactId>
        <version>${terracotta-toolkit-api-internal.version}</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>org.eclipse.jetty</groupId>
        <artifactId>jetty-servlet</artifactId>
        <version>8.1.9.v20130131</version>
        <exclusions>
          <exclusion>
            <artifactId>javax.servlet</artifactId>
            <groupId>org.eclipse.jetty.orbit</groupId>
          </exclusion>
        </exclusions>
      </dependency>

      <!-- Test dependencies -->

      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.11</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>javax.transaction</groupId>
        <artifactId>jta</artifactId>
        <version>1.1</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit-dep</artifactId>
        <version>4.11</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.hamcrest</groupId>
        <artifactId>hamcrest-all</artifactId>
        <version>1.2</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-orm</artifactId>
        <version>3.0.5.RELEASE</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>commons-dbcp</groupId>
        <artifactId>commons-dbcp</artifactId>
        <version>1.3</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-entitymanager</artifactId>
        <version>3.6.3.Final</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>com.h2database</groupId>
        <artifactId>h2</artifactId>
        <version>1.3.154</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.hamcrest</groupId>
        <artifactId>hamcrest-core</artifactId>
        <version>1.2</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.hamcrest</groupId>
        <artifactId>hamcrest-library</artifactId>
        <version>1.2</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>jfree</groupId>
        <artifactId>jfreechart</artifactId>
        <version>1.0.12</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.codehaus.btm</groupId>
        <artifactId>btm</artifactId>
        <version>2.1.3</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-core</artifactId>
        <version>1.9.0</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>asm</groupId>
        <artifactId>asm</artifactId>
        <version>3.2</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.easymock</groupId>
        <artifactId>easymock</artifactId>
        <version>3.0</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-jdk14</artifactId>
        <version>${slf4j.version}</version>
        <scope>test</scope>
      </dependency>
    </dependencies>
    
  </dependencyManagement>

  <build>
    <pluginManagement>
      <plugins>
        <!-- disable surefire to use maven-forge-plugin instead -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>${surefire.version}</version>
          <configuration>
            <skip>true</skip>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>2.3.2</version>
          <configuration>
            <archive>
              <manifest>
                <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
              </manifest>
            </archive>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.terracotta</groupId>
          <artifactId>maven-forge-plugin</artifactId>
          <version>${maven-forge-plugin.version}</version>
          <configuration>
            <forkMode>always</forkMode>
            <argLine>-XX:MaxDirectMemorySize=130m</argLine>
          </configuration>
          <executions>
            <execution>
              <id>default-test</id>
              <phase>test</phase>
              <goals>
                <goal>test</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.codehaus.gmaven</groupId>
          <artifactId>gmaven-plugin</artifactId>
          <version>${gmaven-plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-dependency-plugin</artifactId>
          <version>2.8</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>build-helper-maven-plugin</artifactId>
          <version>1.7</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-antrun-plugin</artifactId>
          <version>1.3</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-shade-plugin</artifactId>
          <version>2.1</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-checkstyle-plugin</artifactId>
          <version>2.9.1</version>
        </plugin>
        <plugin>
          <groupId>org.sonatype.plugins</groupId>
          <artifactId>nexus-staging-maven-plugin</artifactId>
          <version>1.6.1</version>
          <extensions>true</extensions>
          <configuration>
            <!-- The Base URL of Nexus instance where we want to stage -->
            <nexusUrl>http://nexus.terracotta.eur.ad.sag</nexusUrl>
            <!-- The server "id" element from settings to use authentication from -->
            <serverId>terracotta-nexus-staging</serverId>
            <!--<skipNexusStagingDeployMojo>${skipDeploy}</skipNexusStagingDeployMojo>-->
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>
      <plugin>
        <groupId>org.terracotta</groupId>
        <artifactId>maven-forge-plugin</artifactId>
      </plugin>        
      <plugin>
        <groupId>org.sonatype.plugins</groupId>
        <artifactId>nexus-staging-maven-plugin</artifactId>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>skip-system-tests</id>
      <activation>
        <property>
          <name>!jenkins.publisher</name>
        </property>
      </activation>
      <modules>
        <module>system-tests</module>
        <module>lrt-system-tests</module>
      </modules>
    </profile>
    <profile>
      <id>os</id>
      <modules>
        <module>ehcache-os</module>
      </modules>
    </profile>
    <profile>
      <id>offheap</id>
      <modules>
        <module>offheap-store</module>
      </modules>
    </profile>
    <profile>
      <id>all</id>
      <modules>
        <module>ehcache-os</module>
        <module>offheap-store</module>
      </modules>
    </profile>
    <profile>
      <id>dist</id>
      <modules>
        <module>distribution</module>
      </modules>
    </profile> 

    <!-- Profile for running only check-short -->
    <profile>
      <id>check-short</id>
      <properties>
        <checkshort>true</checkshort>
      </properties>
      <build>
        <plugins>
          <plugin>
            <groupId>org.reflections</groupId>
            <artifactId>reflections-maven</artifactId>
            <version>0.9.9-RC1</version>
            <configuration>
              <scanners>org.reflections.scanners.TypeAnnotationsScanner</scanners>
              <destinations>${project.build.directory}/reflections.xml</destinations>
              <tests>true</tests>
              <parallel>true</parallel>
            </configuration>
            <executions>
              <execution>
                <goals>
                  <goal>reflections</goal>
                </goals>
                <phase>process-test-classes</phase>
              </execution>
            </executions>
          </plugin>        
          <plugin>
            <groupId>org.terracotta</groupId>
            <artifactId>maven-forge-plugin</artifactId>
            <configuration>
              <useReflectionFile>true</useReflectionFile>
              <groups>org.terracotta.test.categories.CheckShorts</groups>
              <systemProperties>
                <property>
                  <name>net.sf.ehcache.skipUpdateCheck</name>
                  <value>true</value>
                </property>
                <property>
                  <name>java.awt.headless</name>
                  <value>true</value>
                </property>
              </systemProperties>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile> 
    <!-- this profile is used to override parent pom's profile so that we don't accidentally
         deploy EE artifacts to sourceforge -->
    <profile>
      <id>deploy-sourceforge</id>
    </profile>   
  </profiles>

  <distributionManagement>
    <repository>
      <id>terracotta-nexus-staging</id>
      <name>Terracotta Nexus Staging Repository</name>
      <url>${terracotta-nexus-staging-url}</url>
    </repository>
    <snapshotRepository>
      <id>terracotta-ee-snapshots</id>
       <uniqueVersion>false</uniqueVersion>
       <name>Terracotta EE Snapshots Repository</name>
       <url>${terracotta-ee-snapshots-url}</url>
    </snapshotRepository>
  </distributionManagement>

</project>
