<?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/maven-v4_0_0.xsd">

  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>org.terracotta</groupId>
    <artifactId>terracotta-root</artifactId>
    <version>3.7.3</version>
    <relativePath>..</relativePath>
  </parent>

  <artifactId>build-parent</artifactId>
  <name>build-parent</name>
  <packaging>pom</packaging>

  <licenses>
    <license>
      <name>Terracotta Public License</name>
      <url>http://www.terracotta.org/legal/terracotta-public-license</url>
    </license>
  </licenses>

  <properties>
    <group>unit</group>
    
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <tim-api.version>1.3.0</tim-api.version>
    <sigar.version>1.6.4</sigar.version>
    <jetty.version>6.1.8</jetty.version>
    <slf4j.version>1.6.1</slf4j.version>
    <offheap-store.version>1.0.9</offheap-store.version>
    <search.version>1.1.0</search.version>
    <security-core-version>1.0.3</security-core-version>
    <security-keychain-version>1.0.3</security-keychain-version>
    <management.version>1.0.2</management.version>
    <terracotta-license.version>1.0.5</terracotta-license.version>
    <derby.version>10.8.2.2</derby.version>
    <tc-config.version>3.7.0</tc-config.version>
    <sleepycat.version>5.0.55</sleepycat.version>
    <linked-child-process.version>1.0.6</linked-child-process.version>
    <gmaven-plugin.version>1.3</gmaven-plugin.version>
    <surefire.version>2.10</surefire.version>
    <maven-forge-plugin.version>1.0.5</maven-forge-plugin.version>
    <copy-maven-plugin.version>0.2.3.8</copy-maven-plugin.version>
    <skip.deploy>false</skip.deploy>
    <skip.testjar>false</skip.testjar>
    <listName>checkshort.txt</listName>
    <localMavenRepository>${user.home}/.m2/repository</localMavenRepository>

    <tc.tests.configuration.properties.file>${project.build.testOutputDirectory}/tc.tests.properties</tc.tests.configuration.properties.file>
    <tc.system.tests.properties>${project.build.testOutputDirectory}/com/tc/properties/tests.properties</tc.system.tests.properties>
    <tc.config>-Dtc.config=tc-config.xml</tc.config>
    <tc.base-dir>${project.build.directory}</tc.base-dir>
    <com.tc.l1.modules.repositories>${localMavenRepository}</com.tc.l1.modules.repositories>
    <tc.tests.configuration.transparent-tests.mode>normal</tc.tests.configuration.transparent-tests.mode>
    <tc.tests.info.bootjars.normal>${basedir}/../target/dso-boot.jar</tc.tests.info.bootjars.normal>
    <tc.tests.info.property-files>${tc.tests.configuration.properties.file}</tc.tests.info.property-files>
    <tc.tests.info.temp-root>${project.build.directory}/temp</tc.tests.info.temp-root>
    <tc.tests.info.linked-child-process-classpath>${localMavenRepository}/org/terracotta/linked-child-process/${linked-child-process.version}/linked-child-process-${linked-child-process.version}.jar</tc.tests.info.linked-child-process-classpath>
    <tc.tests.info.junit-test-timeout-inseconds>1800</tc.tests.info.junit-test-timeout-inseconds>
    <tc.tests.info.l2.startup.mode>internal</tc.tests.info.l2.startup.mode>
    <tc.bootclasspath/>
    <surefire.min-memory>64m</surefire.min-memory>
    <surefire.max-memory>512m</surefire.max-memory>
    <surefire.additional-jvm-args/>
    <should_skip_tests>true</should_skip_tests>
    <surefire.jvm.mode>-server</surefire.jvm.mode>
    <surefire.argLine>${surefire.jvm.mode} ${tc.bootclasspath}
      -Xms${surefire.min-memory}
      -Xmx${surefire.max-memory}
      -XX:+HeapDumpOnOutOfMemoryError
      -DlistName=${listName}
      -Dtc.base-dir=${tc.base-dir} ${tc.config}
      -Dtc.dso.globalmode=false
      -Dtc.tests.info.property-files=${tc.tests.info.property-files}
      -Dcom.tc.l1.modules.repositories=${localMavenRepository}
      -Dcom.tc.properties=${tc.system.tests.properties}
      -Dcom.tc.sigar.enabled=true
      -Dtc.install-root.ignore-checks=true
      -Dcom.sun.management.jmxremote 
      ${surefire.additional-jvm-args}</surefire.argLine>   
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.terracotta</groupId>
        <artifactId>linked-child-process</artifactId>
        <version>${linked-child-process.version}</version>
      </dependency>
      <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.16</version>
      </dependency>
      <dependency>
        <groupId>commons-logging</groupId>
        <artifactId>commons-logging</artifactId>
        <version>1.0.3</version>
      </dependency>
      <dependency>
        <groupId>commons-collections</groupId>
        <artifactId>commons-collections</artifactId>
        <version>3.2.1</version>
      </dependency>
      <dependency>
        <groupId>commons-lang</groupId>
        <artifactId>commons-lang</artifactId>
        <version>2.0</version>
      </dependency>
      <dependency>
        <groupId>commons-cli</groupId>
        <artifactId>commons-cli</artifactId>
        <version>1.1</version>
      </dependency>
      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-io</artifactId>
        <version>1.3.2</version>
      </dependency>
      <dependency>
        <groupId>commons-httpclient</groupId>
        <artifactId>commons-httpclient</artifactId>
        <version>3.1</version>
      </dependency>
      <dependency>
        <groupId>javax.management</groupId>
        <artifactId>jmxremote</artifactId>
        <version>1.0.1_04</version>
      </dependency>
      <dependency>
        <groupId>org.terracotta</groupId>
        <artifactId>jmxremote_optional-tc</artifactId>
        <version>1.0.4</version>
      </dependency>
      <dependency>
        <groupId>org.beanshell</groupId>
        <artifactId>bsh</artifactId>
        <version>2.0b4</version>
      </dependency>
      <dependency>
        <groupId>org.apache.xmlbeans</groupId>
        <artifactId>xmlbeans</artifactId>
        <version>2.4.0</version>
        <exclusions>
          <exclusion>
            <groupId>stax</groupId>
            <artifactId>stax-api</artifactId>
          </exclusion>
        </exclusions>        
      </dependency>
      <dependency>
        <groupId>org.apache.xmlbeans</groupId>
        <artifactId>xmlbeans-jsr173-api</artifactId>
        <version>1.0</version>
      </dependency>
      <dependency>
        <groupId>knopflerfish-tc</groupId>
        <artifactId>knopflerfish-tc</artifactId>
        <version>2.0.1-20100819</version>
      </dependency>
      <dependency>
        <groupId>org.mortbay.jetty</groupId>
        <artifactId>servlet-api-2.5</artifactId>
        <version>${jetty.version}</version>
      </dependency>
      <dependency>
        <groupId>org.mortbay.jetty</groupId>
        <artifactId>jetty-util</artifactId>
        <version>${jetty.version}</version>
      </dependency>
      <dependency>
        <groupId>org.mortbay.jetty</groupId>
        <artifactId>jetty</artifactId>
        <version>${jetty.version}</version>
      </dependency>
      <dependency>
        <groupId>concurrent</groupId>
        <artifactId>concurrent</artifactId>
        <version>1.3.4</version>
      </dependency>
      <dependency>
        <groupId>trove</groupId>
        <artifactId>trove</artifactId>
        <version>1.1-beta-5</version>
      </dependency>
      <dependency>
        <groupId>com.sleepycat</groupId>
        <artifactId>je</artifactId>
        <version>${sleepycat.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.derby</groupId>
        <artifactId>derby</artifactId>
        <version>${derby.version}</version>
      </dependency>
      <dependency>
        <groupId>jline</groupId>
        <artifactId>jline</artifactId>
        <version>0.9.94</version>
      </dependency>
      <dependency>
        <groupId>jfree</groupId>
        <artifactId>jfreechart</artifactId>
        <version>1.0.13</version>
        <exclusions>
          <exclusion>
            <groupId>gnujaxp</groupId>
            <artifactId>gnujaxp</artifactId>
          </exclusion>
        </exclusions>
      </dependency>       
      <dependency>
        <groupId>treemap</groupId>
        <artifactId>treemap</artifactId>
        <version>2.5.1</version>
      </dependency>
      <dependency>
        <groupId>com.h2database</groupId>
        <artifactId>h2</artifactId>
        <version>1.0.67</version>
      </dependency>
      <dependency>
        <groupId>net.sourceforge</groupId>
        <artifactId>yamlbeans</artifactId>
        <version>0.9.2</version>
      </dependency>
      <dependency>
        <groupId>com.google.code.guice</groupId>
        <artifactId>guice</artifactId>
        <version>1.0</version>
      </dependency>
      <dependency>
        <groupId>org.terracotta</groupId>
        <artifactId>google-collections-tc</artifactId>
        <version>1.0.1</version>
      </dependency>
      <dependency>
        <groupId>com.terracottatech</groupId>
        <artifactId>offheap-store</artifactId>
        <version>${offheap-store.version}</version>
      </dependency>
      <dependency>
    	<groupId>com.terracotta</groupId>
    	<artifactId>security-core</artifactId>
    	<version>${security-core-version}</version>
      </dependency>
      <dependency>
    	<groupId>com.terracotta</groupId>
    	<artifactId>security-keychain</artifactId>
    	<version>${security-keychain-version}</version>
      </dependency>
      <dependency>
        <groupId>com.terracottatech</groupId>
        <artifactId>search-ee</artifactId>
        <version>${search.version}</version>
        <exclusions>
          <exclusion>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-core</artifactId>
          </exclusion>          
        </exclusions>
      </dependency>
      <dependency>
        <groupId>com.terracottatech</groupId>
        <artifactId>search</artifactId>
        <version>${search.version}</version>
      </dependency>          
      <dependency>
        <groupId>org.terracotta.license</groupId>
        <artifactId>terracotta-license</artifactId>
        <version>${terracotta-license.version}</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${slf4j.version}</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
        <version>${slf4j.version}</version>
      </dependency>
      <dependency>
        <groupId>jfree</groupId>
        <artifactId>jcommon</artifactId>
        <version>1.0.16</version>
      </dependency>
      <dependency>
        <groupId>commons-codec</groupId>
        <artifactId>commons-codec</artifactId>
        <version>1.2</version>
      </dependency>      

      <dependency>
        <groupId>hsqldb</groupId>
        <artifactId>hsqldb</artifactId>
        <version>1.7.2.2</version>
      </dependency>
      <dependency>
        <groupId>httpunit</groupId>
        <artifactId>httpunit</artifactId>
        <version>1.6</version>
      </dependency>

      <!-- Dependencies for core Terracotta artifacts -->
      <dependency>
        <groupId>org.terracotta</groupId>
        <artifactId>tcconfig</artifactId>
        <version>${tc-config.version}</version>
      </dependency>
      <dependency>
        <groupId>org.terracotta</groupId>
        <artifactId>tc-l1-reconnect-properties</artifactId>
        <version>${tc-config.version}</version>
      </dependency>
      <dependency>
        <groupId>org.terracotta</groupId>
        <artifactId>tcstats</artifactId>
        <version>${tc-config.version}</version>
      </dependency>
      <dependency>
        <groupId>org.terracotta.api</groupId>
        <artifactId>tim-api</artifactId>
        <version>${tim-api.version}</version>
        <exclusions>
          <exclusion>
            <groupId>org.terracotta.api</groupId>
            <artifactId>thirdparty-api</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.terracotta.api</groupId>
            <artifactId>dso-cluster-api</artifactId>
          </exclusion>          
        </exclusions>        
      </dependency>

      <!-- SIGAR dependencies -->
      <dependency>
        <groupId>org.hyperic</groupId>
        <artifactId>sigar</artifactId>
        <version>${sigar.version}</version>
        <type>jar</type>
      </dependency>
      <!-- linux -->
      <dependency>
        <groupId>org.hyperic</groupId>
        <artifactId>libsigar-amd64-linux</artifactId>
        <version>${sigar.version}</version>
        <type>so</type>
      </dependency>
      <dependency>
        <groupId>org.hyperic</groupId>
        <artifactId>libsigar-x86-linux</artifactId>
        <version>${sigar.version}</version>
        <type>so</type>
      </dependency>

      <!-- solaris -->
      <dependency>
        <groupId>org.hyperic</groupId>
        <artifactId>libsigar-amd64-solaris</artifactId>
        <version>${sigar.version}</version>
        <type>so</type>
      </dependency>
      <dependency>
        <groupId>org.hyperic</groupId>
        <artifactId>libsigar-sparc-solaris</artifactId>
        <version>${sigar.version}</version>
        <type>so</type>
      </dependency>
      <dependency>
        <groupId>org.hyperic</groupId>
        <artifactId>libsigar-sparc64-solaris</artifactId>
        <version>${sigar.version}</version>
        <type>so</type>
      </dependency>      
      <dependency>
        <groupId>org.hyperic</groupId>
        <artifactId>libsigar-x86-solaris</artifactId>
        <version>${sigar.version}</version>
        <type>so</type>
      </dependency>

      <!-- windows -->
      <dependency>
        <groupId>org.hyperic</groupId>
        <artifactId>sigar-amd64-winnt</artifactId>
        <version>${sigar.version}</version>
        <type>dll</type>
      </dependency>
      <dependency>
        <groupId>org.hyperic</groupId>
        <artifactId>sigar-x86-winnt</artifactId>
        <version>${sigar.version}</version>
        <type>dll</type>
      </dependency>
      <dependency>
        <groupId>org.hyperic</groupId>
        <artifactId>sigar-x86-winnt</artifactId>
        <version>${sigar.version}</version>
        <type>lib</type>
      </dependency>

      <!-- mac osx -->
      <dependency>
        <groupId>org.hyperic</groupId>
        <artifactId>libsigar-universal-macosx</artifactId>
        <version>${sigar.version}</version>
        <type>dylib</type>
      </dependency>
      <dependency>
        <groupId>org.hyperic</groupId>
        <artifactId>libsigar-universal64-macosx</artifactId>
        <version>${sigar.version}</version>
        <type>dylib</type>
      </dependency>

      <!-- tests -->
      <dependency>
        <groupId>org.apache.ant</groupId>
        <artifactId>ant</artifactId>
        <version>1.7.1</version>
      </dependency>
      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-all</artifactId>
        <version>1.8.2</version>
      </dependency>
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.8.1</version>
      </dependency>
      <dependency>
        <groupId>org.terracotta</groupId>
        <artifactId>native-tool</artifactId>
        <version>1.0.2</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.terracotta</groupId>
      <artifactId>linked-child-process</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.terracotta</groupId>
      <artifactId>native-tool</artifactId>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <groupId>org.apache.commons</groupId>
          <artifactId>commons-io</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.apache.ant</groupId>
          <artifactId>ant</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-all</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.ant</groupId>
      <artifactId>ant</artifactId>
      <scope>test</scope>
    </dependency>    
  </dependencies>

  <build>
    <resources>
      <resource>
        <directory>${basedir}/src/main/resources</directory>
        <filtering>false</filtering>
      </resource>
      <resource>
        <directory>${basedir}/src/main/filtered-resources</directory>
        <filtering>true</filtering>
      </resource>
    </resources>

    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>2.3.2</version>
          <configuration>
            <fork>true</fork>
            <meminitial>128</meminitial>
            <maxmem>512</maxmem>
            <source>1.5</source>
            <target>1.5</target>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.codehaus.gmaven</groupId>
          <artifactId>gmaven-plugin</artifactId>
          <version>${gmaven-plugin.version}</version>
          <executions>
            <execution>
              <id>generate-test-properties</id>
              <phase>process-test-resources</phase>
              <goals>
                <goal>execute</goal>
              </goals>
              <configuration>
                <source><![CDATA[
                  Properties outputProperties = new Properties()
                  project.properties.each { key, value ->
                    if (key =~ /^tc\.tests\./) {
                      outputProperties.setProperty(key, value)
                    }
                  }
                  String propertiesFileName = project.properties.getProperty(
                      "tc.tests.configuration.properties.file")
                  File propertiesFile = new File(propertiesFileName)
                  assert !propertiesFile.isDirectory()
                  propertiesFile.parentFile.mkdirs()
                  def outputStream = new FileOutputStream(propertiesFile)
                  try {
                    outputProperties.store(outputStream, "")
                  }
                  finally {
                    outputStream.close()
                  }
                  ]]></source>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <!-- we include the surefire plugin to get a known version and to always tell
               it to skip tests. The toolkit resolver plugin is the actual thing that runs
               tests -->
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>${surefire.version}</version>
          <configuration>
            <skipTests>true</skipTests>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.terracotta</groupId>
          <artifactId>maven-forge-plugin</artifactId>
          <version>${maven-forge-plugin.version}</version>
          <configuration>
            <skipTests>true</skipTests>
          </configuration>
          <executions>
            <execution>
              <id>create-build-info</id>
              <goals>
                <goal>buildinfo</goal>
              </goals>
              <phase>generate-resources</phase>
              <configuration>
                <rootPath>${basedir}/..</rootPath>
              </configuration>
            </execution>          
            <execution>
              <id>default-test</id>
              <phase>integration-test</phase>
              <goals>
                <goal>test</goal>
              </goals>
              <configuration>
                <failIfNoTests>false</failIfNoTests>
                <printSummary>true</printSummary>
                <reportFormat>plain</reportFormat>
                <includes>
                 <include>**/*Test.java</include>
                </includes>         
                <skipTests>${should_skip_tests}</skipTests>
                <forkMode>always</forkMode>
                <forkedProcessTimeoutInSeconds>${tc.tests.info.junit-test-timeout-inseconds}</forkedProcessTimeoutInSeconds>
                <useSystemClassLoader>true</useSystemClassLoader>
                <workingDirectory>${project.build.directory}/temp</workingDirectory>
                <__TC_devLog>true</__TC_devLog>
                <argLine>${surefire.argLine}</argLine>
              </configuration>
            </execution>
          </executions>
        </plugin>        
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>2.3.1</version>
          <executions>
            <execution>
              <goals>
                <goal>test-jar</goal>
              </goals>
              <configuration>
                <skip>${skip.testjar}</skip>
                <excludes>
                  <exclude>**/*Test.class</exclude>
                  <exclude>build-data.txt</exclude>
                </excludes>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>2.2.1</version>
          <executions>
            <execution>
              <goals>
                <goal>test-jar</goal>
              </goals>
              <configuration>
                <forceCreation>true</forceCreation>
                <excludeResources>true</excludeResources>
                <excludes>
                  <exclude>**/*Test.java</exclude>
                  <exclude>**/*TestApp.java</exclude>
                  <exclude>build-data.txt</exclude>
                </excludes>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>2.5</version>
          <configuration>
            <skip>${skip.deploy}</skip>
          </configuration>
        </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>com.goldin.plugins</groupId>
                    <artifactId>
                      maven-properties-plugin
                    </artifactId>
                    <versionRange>[0.2.2,)</versionRange>
                    <goals>
                      <goal>set-properties</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore/>
                  </action>
                </pluginExecution>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>
                      org.apache.maven.plugins
                    </groupId>
                    <artifactId>
                      maven-dependency-plugin
                    </artifactId>
                    <versionRange>[2.2,)</versionRange>
                    <goals>
                      <goal>unpack-dependencies</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore/>
                  </action>
                </pluginExecution>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.codehaus.gmaven</groupId>
                    <artifactId>gmaven-plugin</artifactId>
                    <versionRange>[1.3,)</versionRange>
                    <goals>
                      <goal>execute</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore/>
                  </action>
                </pluginExecution>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>
                      exec-maven-plugin
                    </artifactId>
                    <versionRange>[1.2,)</versionRange>
                    <goals>
                      <goal>exec</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore/>
                  </action>
                </pluginExecution>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.terracotta</groupId>
                    <artifactId>
                      maven-forge-plugin
                    </artifactId>
                    <versionRange>[1.0.2,)</versionRange>
                    <goals>
                      <goal>buildinfo</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <execute/>
                  </action>
                </pluginExecution>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.terracotta</groupId>
                    <artifactId>
                      maven-forge-plugin
                    </artifactId>
                    <versionRange>[1.0.2,)</versionRange>
                    <goals>
                      <goal>manifest</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore/>
                  </action>
                </pluginExecution>                
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>
                      build-helper-maven-plugin
                    </artifactId>
                    <versionRange>[1.5,)</versionRange>
                    <goals>
                      <goal>add-source</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore/>
                  </action>
                </pluginExecution>                
              </pluginExecutions>
            </lifecycleMappingMetadata>
          </configuration>
        </plugin>       
      </plugins>
    </pluginManagement>

    <plugins>
      <plugin>
        <groupId>org.terracotta</groupId>
        <artifactId>maven-forge-plugin</artifactId>
      </plugin>  
      <plugin>
        <groupId>org.codehaus.gmaven</groupId>
        <artifactId>gmaven-plugin</artifactId>
      </plugin>      
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>client-jvm</id>
      <properties>
        <surefire.jvm.mode>-client</surefire.jvm.mode>
      </properties>
    </profile>
    <profile>
      <id>server-jvm</id>
      <properties>
        <surefire.jvm.mode>-server</surefire.jvm.mode>
      </properties>
    </profile>

    <profile>
      <id>workaround-windows</id>
      <activation>
        <os>
          <family>windows</family>
        </os>
      </activation>
      <properties>
        <localMavenRepository>C:\DOCUME~1\${user.name}\.m2\repository</localMavenRepository>
      </properties>
    </profile>
    
    <profile>
      <id>check-short</id>
      <properties>
        <should_skip_tests>false</should_skip_tests>
      </properties>      
      <build>
        <plugins>
          <plugin>
            <groupId>org.terracotta</groupId>
            <artifactId>maven-forge-plugin</artifactId>
            <configuration>
              <__TC_listFile>${basedir}/checkshort.txt</__TC_listFile>
              <failIfNoTests>false</failIfNoTests>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>    

    <profile>
      <id>system-tests</id>
      <properties>
        <should_skip_tests>false</should_skip_tests>
      </properties>
    </profile>

    <profile>
      <!-- Use Berkeley DB for running tests. -->
      <id>berkeleydb</id>
      <properties>
        <surefire.additional-jvm-args>
          -Dcom.tc.l2.db.factory.name=com.tc.objectserver.storage.berkeleydb.BerkeleyDBFactory
        </surefire.additional-jvm-args>
      </properties>
    </profile>
    <profile>
      <!-- Use Derby for running tests. -->
      <id>derby</id>
      <properties>
        <surefire.additional-jvm-args>
          -Dcom.tc.l2.db.factory.name=com.tc.objectserver.storage.derby.DerbyDBFactory
          -Dcom.tc.l2.derbydb.derby.storage.logSwitchInterval=10240000
          -Dcom.tc.l2.derbydb.derby.storage.checkpointInterval=10240000
        </surefire.additional-jvm-args>
      </properties>
    </profile>


    <profile>
      <id>check</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.gmaven</groupId>
            <artifactId>gmaven-plugin</artifactId>
            <version>${gmaven-plugin.version}</version>
            <executions>
              <execution>
                <id>decide-which-group-should-run-tests</id>
                <phase>process-test-resources</phase>
                <goals>
                  <goal>execute</goal>
                </goals>
                <configuration>
                  <source>
                    def target = project.properties['target']
                    if (target == null) fail("-Dtarget needs to be set for this profile")
                    def targetSet = new HashSet(Arrays.asList(target.split(",")))
                    def projectGroups = new HashSet()
                    if (project.properties['group'] != null) {
                      projectGroups.addAll(Arrays.asList(project.properties['group'].split(",")))
                    }
                    targetSet.retainAll(projectGroups)
                    def shouldSkipTest = targetSet.size() == 0
                    project.properties.should_skip_tests = String.valueOf(shouldSkipTest)
                  </source>
                </configuration>
              </execution>
            </executions>
          </plugin>         
        </plugins>          
      </build>
    </profile>

  </profiles>

  <repositories>
    <repository>
      <id>terracotta-snapshots</id>
      <url>http://www.terracotta.org/download/reflector/snapshots</url>
      <releases>
        <enabled>false</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </repository>
    <repository>
      <id>terracotta-releases</id>
      <url>http://www.terracotta.org/download/reflector/releases</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
    <repository>
      <id>oracle</id>
      <url>http://download.oracle.com/maven/</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
    <repository>
      <id>jboss</id>
      <url>http://repository.jboss.com/maven2</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
    <repository>
      <id>evgeny-goldin</id>
      <url>http://evgeny-goldin.org/artifactory/repo</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>    
  </repositories>
  <pluginRepositories>
    <pluginRepository>
      <id>terracotta-snapshots</id>
      <url>http://www.terracotta.org/download/reflector/snapshots</url>
      <releases>
        <enabled>false</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </pluginRepository>
    <pluginRepository>
      <id>terracotta-releases</id>
      <url>http://www.terracotta.org/download/reflector/releases</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </pluginRepository>
    <pluginRepository>
      <id>evgenyg.artifactoryonline.com</id>
      <url>http://evgenyg.artifactoryonline.com/evgenyg/repo/</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </pluginRepository>  
  </pluginRepositories>
</project>
