<?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.7.7</version>
  <packaging>pom</packaging>

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

  <scm>
    <developerConnection>scm:svn:https://svn.terracotta.org/repo/internal/ehcache-enterprise/ehcache-core-ee/branches/ehcache-core-ee-2.7.x</developerConnection>
  </scm>
  
  <properties>
    <ehcache.os.version>${project.version}</ehcache.os.version>
    <terracotta-license.version>1.1.2</terracotta-license.version>
    <slf4j.version>1.6.6</slf4j.version>
    <offheap-store.version>1.1.6</offheap-store.version>
    <search.version>1.3.0</search.version>
    <maven-forge-plugin.version>1.2.5</maven-forge-plugin.version>
    <bigmemory.version>4.0.7</bigmemory.version>
    <security.version>1.3.17</security.version>
    <shiro.version>1.2.3</shiro.version>
    <terracotta-toolkit-api.version>2.3</terracotta-toolkit-api.version>
    <terracotta-toolkit-api-internal.version>1.1</terracotta-toolkit-api-internal.version>
    <statistics.version>1.0.1</statistics.version>
    <gmaven-plugin.version>1.4</gmaven-plugin.version>

    <!-- Remove once parent pom is updated -->
    <terracotta-nexus-staging-url>http://nexus.terracotta.eur.ad.sag/service/local/staging/deploy/maven2</terracotta-nexus-staging-url>
    <terracotta-ee-snapshots-url>http://nexus.terracotta.eur.ad.sag/content/repositories/terracotta-ee-snapshots</terracotta-ee-snapshots-url>
  </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.apache.shiro</groupId>
        <artifactId>shiro-web</artifactId>
        <version>${shiro.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.shiro</groupId>
        <artifactId>shiro-core</artifactId>
        <version>${shiro.version}</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${slf4j.version}</version>
      </dependency>
      <dependency>
        <groupId>org.terracotta.bigmemory</groupId>
        <artifactId>bigmemory</artifactId>
        <version>${bigmemory.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</artifactId>
        <version>${terracotta-toolkit-api.version}</version>
        <scope>provided</scope>
      </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.7.v20120910</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.10</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.10</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>2.10</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>
        </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.3</version>
          <dependencies>
            <dependency>
              <groupId>org.terracotta.maven.plugins</groupId>
              <artifactId>terracotta-shader</artifactId>
              <version>1.2</version>
            </dependency>
          </dependencies>          
        </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.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> 

    <!-- this profile is used to override parent pom's profile so that we don't accidentally
         deploy EE artifacts to Sonatype/Maven Central -->
    <profile>
      <id>deploy-sonatype</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>
