<?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.21</version>
    <relativePath/>
  </parent>

  <name>ehcache-root</name>
  <groupId>net.sf.ehcache</groupId>
  <artifactId>ehcache-root</artifactId>
  <packaging>pom</packaging>
  <version>2.10.5</version>

  <scm>
    <developerConnection>scm:svn:https://svn.terracotta.org/repo/ehcache/trunk/ehcache</developerConnection>
  </scm>
  
  <properties>
    <slf4j.version>1.7.25</slf4j.version>
    <sizeof-agent.version>1.0.1</sizeof-agent.version>
    <gmaven-plugin.version>1.4</gmaven-plugin.version>
    <surefire.version>2.15</surefire.version>
    <terracotta-toolkit-api-internal.version>1.17</terracotta-toolkit-api-internal.version>
    <management-core.version>2.0.16</management-core.version>
    <clustered-entity-management.version>0.10.0</clustered-entity-management.version>
    <statistics.version>1.0.2</statistics.version>
    <quartz.version>2.2.3</quartz.version>
    <jetty.version>8.1.15.v20140411</jetty.version>
  </properties>

  <modules>
    <module>ehcache-core</module>
    <module>terracotta</module>
    <module>ehcache</module>
    <module>management-ehcache-v1</module>
    <module>management-ehcache-v2</module>
    <module>management-ehcache-impl</module>
    <module>ehcache-scheduled-refresh</module>
    <module>ehcache-search-parser</module>
  </modules>

  <dependencyManagement>
    <dependencies>
      <!-- Required dependencies -->
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${slf4j.version}</version>
      </dependency>
      <dependency>
        <groupId>org.terracotta.internal</groupId>
        <artifactId>statistics</artifactId>
        <version>${statistics.version}</version>
      </dependency>
      <dependency>
        <groupId>org.terracotta</groupId>
        <artifactId>management-core-resources</artifactId>
        <version>${management-core.version}</version>
      </dependency>
      <dependency>
        <groupId>com.terracotta</groupId>
        <artifactId>clustered-entity-management</artifactId>
        <version>${clustered-entity-management.version}</version>
      </dependency>
      <dependency>
        <groupId>org.eclipse.jetty</groupId>
        <artifactId>jetty-servlet</artifactId>
        <version>${jetty.version}</version>
        <exclusions>
          <exclusion>
            <artifactId>javax.servlet</artifactId>
            <groupId>org.eclipse.jetty.orbit</groupId>
          </exclusion>
        </exclusions>
      </dependency>

      <dependency>
        <groupId>gf-3122</groupId>
        <artifactId>gf.javax.servlet-api</artifactId>
        <version>3.0.1</version>
      </dependency>

      <!-- Provided dependencies -->
      <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>javax.servlet</groupId>
        <artifactId>javax.servlet-api</artifactId>
        <version>3.0.1</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-core</artifactId>
        <version>3.5.1-Final</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>javax.transaction</groupId>
        <artifactId>jta</artifactId>
        <version>1.1</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>net.sf.ehcache</groupId>
        <artifactId>sizeof-agent</artifactId>
        <version>1.0.1</version>
        <scope>provided</scope>
      </dependency>

      <!-- Test dependencies -->
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-jdk14</artifactId>
        <version>${slf4j.version}</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>net.sf.hibernate</groupId>
        <artifactId>hibernate</artifactId>
        <version>2.1.8</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.hamcrest</groupId>
        <artifactId>hamcrest-core</artifactId>
        <version>1.3</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.hamcrest</groupId>
        <artifactId>hamcrest-library</artifactId>
        <version>1.3</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.11</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>dom4j</groupId>
        <artifactId>dom4j</artifactId>
        <version>1.6.1</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>javassist</groupId>
        <artifactId>javassist</artifactId>
        <version>3.4.GA</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-ehcache</artifactId>
        <version>3.3.2.GA</version>
        <scope>test</scope>
        <exclusions>
          <exclusion>
            <artifactId>ehcache</artifactId>
            <groupId>net.sf.ehcache</groupId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>commons-logging</groupId>
        <artifactId>commons-logging</artifactId>
        <version>1.1.1</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.apache.derby</groupId>
        <artifactId>derby</artifactId>
        <version>10.5.3.0_1</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>com.sun.xsom</groupId>
        <artifactId>xsom</artifactId>
        <version>20100725</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.beanshell</groupId>
        <artifactId>bsh</artifactId>
        <version>1.3.0</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.quartz-scheduler</groupId>
        <artifactId>quartz</artifactId>
        <version>${quartz.version}</version>
      </dependency>
      <dependency>
        <groupId>org.easymock</groupId>
        <artifactId>easymock</artifactId>
        <version>3.0</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.powermock</groupId>
        <artifactId>powermock-api-easymock</artifactId>
        <version>1.4.10</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.powermock</groupId>
        <artifactId>powermock-module-junit4</artifactId>
        <version>1.4.10</version>
        <scope>test</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <build>
    <pluginManagement>
      <plugins>
        <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.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>${surefire.version}</version>
          <configuration>
            <skip>true</skip><!-- we use maven-forge-plugin to run tests -->
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>2.8.1</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-checkstyle-plugin</artifactId>
          <version>2.9.1</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.terracotta</groupId>
          <artifactId>maven-forge-plugin</artifactId>
          <version>${maven-forge-plugin.version}</version>
          <configuration>
            <argLine>-Djava.net.preferIPv4Stack=true</argLine>
          </configuration>
        </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.codehaus.gmaven</groupId>
          <artifactId>gmaven-plugin</artifactId>
          <version>${gmaven-plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>rmic-maven-plugin</artifactId>
          <version>1.1</version>
        </plugin>
        <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
        <plugin>
          <groupId>org.eclipse.m2e</groupId>
          <artifactId>lifecycle-mapping</artifactId>
          <version>1.0.0</version>
          <configuration>
            <lifecycleMappingMetadata>
              <pluginExecutions>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>javacc-maven-plugin</artifactId>
                    <versionRange>[2.6,)</versionRange>
                    <goals>
                      <goal>javacc</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore/>
                  </action>
                </pluginExecution>
              </pluginExecutions>
            </lifecycleMappingMetadata>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.terracotta</groupId>
        <artifactId>maven-forge-plugin</artifactId>      
        <executions>
          <execution>
            <id>generateBuildInfoFile</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>buildinfo</goal>
            </goals>
            <configuration>
              <generateBuildInfoFile>true</generateBuildInfoFile>
              <buildInfoLocation>${project.build.outputDirectory}</buildInfoLocation>
            </configuration>
          </execution>
          <execution>
            <id>default-test</id>
            <phase>test</phase>
            <goals>
              <goal>test</goal>
            </goals>
          </execution>
        </executions>
      </plugin>    
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>system-tests</id>
      <modules>
        <module>system-tests</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>
        <skipJavadoc>true</skipJavadoc>
      </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>java.awt.headless</name>
                  <value>true</value>
                </property>
              </systemProperties>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <!-- Profile to configure deployment to Terracotta Nexus using pro features -->
      <id>deploy-terracotta</id>
      <build>
        <pluginManagement>
          <plugins>
            <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>
    </profile>
    <profile>
      <!-- Profile needed even though identical with one found in parent pom as distributionManagement is declared locally -->
      <id>deploy-sonatype</id>
      <distributionManagement>
        <repository>
          <id>sonatype-nexus-staging</id>
          <url>http://oss.sonatype.org/service/local/staging/deploy/maven2</url>
        </repository>
        <snapshotRepository>
          <id>sonatype-nexus-snapshots</id>
          <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
      </distributionManagement>
    </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-os-snapshots</id>
       <uniqueVersion>false</uniqueVersion>
       <name>Terracotta OS Snapshots Repository</name>
       <url>${terracotta-os-snapshots-url}</url>
    </snapshotRepository>
  </distributionManagement>

  <repositories>
    <repository>
      <id>terracotta-snapshots</id>
      <url>http://www.terracotta.org/download/reflector/snapshots</url>
    </repository>
    <repository>
      <id>terracotta-releases</id>
      <url>http://www.terracotta.org/download/reflector/releases</url>
    </repository>
  </repositories>

  <pluginRepositories>
    <pluginRepository>
      <id>terracotta-snapshots</id>
      <url>http://www.terracotta.org/download/reflector/snapshots</url>
    </pluginRepository>
    <pluginRepository>
      <id>terracotta-releases</id>
      <url>http://www.terracotta.org/download/reflector/releases</url>
    </pluginRepository>
  </pluginRepositories>   
</project>
