<?xml version="1.0" encoding="UTF-8"?>
<!--
The contents of this file are subject to the Terracotta Public License Version
2.0 (the "License"); You may not use this file except in compliance with the
License. You may obtain a copy of the License at 

     http://terracotta.org/legal/terracotta-public-license.

Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
the specific language governing rights and limitations under the License.

The Covered Software is Terracotta Platform.

The Initial Developer of the Covered Software is 
     Terracotta, Inc., a Software AG company
-->
<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>4.3.2</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>
    <core-storage-api.version>1.3.2</core-storage-api.version>
    <heap-core-storage.version>1.1.2</heap-core-storage.version>
    <bigmemory-core-storage.version>2.0.0</bigmemory-core-storage.version>
    <jetty.version>8.1.15.v20140411</jetty.version>
    <javax.servlet.version>3.0.0.v201112011016</javax.servlet.version>
    <slf4j.version>1.7.7</slf4j.version>
    <search.version>1.5.0</search.version>
    <shiro.version>1.2.3</shiro.version>
    <management-core-version>2.0.14</management-core-version>
    <session-management.version>${project.version}</session-management.version>
    <tc-messaging.version>1.0.1</tc-messaging.version>
    <terracotta-license.version>1.1.4</terracotta-license.version>
    <toolkit-api.version>2.7</toolkit-api.version> 
    <toolkit-api-internal.version>1.17</toolkit-api-internal.version>
    <!-- version of ehcache embedded inside toolkit -->
    <ehcache.version>2.10.2</ehcache.version>
    <tcconfig.version>9.2</tcconfig.version>
    <linked-child-process.version>1.0.8</linked-child-process.version>
    <gmaven-plugin.version>1.4</gmaven-plugin.version>
    <copy-maven-plugin.version>0.2.3.8</copy-maven-plugin.version>
    <surefire.version>2.15</surefire.version>
    <powermock.version>1.5.1</powermock.version>
    <hamcrest.version>1.3</hamcrest.version>
    <skip.testjar>false</skip.testjar>
    <listName>checkshort.txt</listName>
    <localMavenRepository>${user.home}/.m2/repository</localMavenRepository>
    <checkstyle-suppressions-file>${basedir}/../checkstyle/suppressions.xml</checkstyle-suppressions-file>

    <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.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>
    <surefire.min-memory>64m</surefire.min-memory>
    <surefire.max-memory>1g</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}
      -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}
      -Dtc.install-root.ignore-checks=true
      -Dcom.sun.management.jmxremote 
      ${surefire.additional-jvm-args}</surefire.argLine>   
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.terracotta.internal</groupId>
        <artifactId>core-storage-api</artifactId>
        <version>${core-storage-api.version}</version>
      </dependency>
      <dependency>
        <groupId>org.terracotta.internal</groupId>
        <artifactId>heap-core-storage</artifactId>
        <version>${heap-core-storage.version}</version>
      </dependency>
      <dependency>
        <groupId>org.terracotta.internal</groupId>
        <artifactId>bigmemory-core-storage</artifactId>
        <version>${bigmemory-core-storage.version}</version>
      </dependency>
      <dependency>
        <groupId>com.terracottatech</groupId>
        <artifactId>search</artifactId>
        <version>${search.version}</version>
      </dependency>
      <dependency>
        <groupId>org.terracotta</groupId>
        <artifactId>tc-messaging</artifactId>
        <version>${tc-messaging.version}</version>
      </dependency>
      <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.17</version>
      </dependency>
      <dependency>
        <groupId>commons-logging</groupId>
        <artifactId>commons-logging</artifactId>
        <version>1.1.1</version>
      </dependency>
      <dependency>
        <groupId>commons-collections</groupId>
        <artifactId>commons-collections</artifactId>
        <version>3.2.2</version>
      </dependency>
      <dependency>
        <groupId>commons-lang</groupId>
        <artifactId>commons-lang</artifactId>
        <version>2.5</version>
      </dependency>
      <dependency>
        <groupId>commons-cli</groupId>
        <artifactId>commons-cli</artifactId>
        <version>1.1</version>
      </dependency>
      <dependency>
        <groupId>commons-io</groupId>
        <artifactId>commons-io</artifactId>
        <version>2.4</version>
      </dependency>
      <dependency>
        <groupId>commons-httpclient</groupId>
        <artifactId>commons-httpclient</artifactId>
        <version>3.1</version>
      </dependency>
      <dependency>
        <groupId>org.terracotta</groupId>
        <artifactId>jmxremote_optional-tc</artifactId>
        <version>1.0.5</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>org.eclipse.jetty</groupId>
        <artifactId>jetty-util</artifactId>
        <version>${jetty.version}</version>
      </dependency>
      <dependency>
        <groupId>org.eclipse.jetty.aggregate</groupId>
        <artifactId>jetty-all-server</artifactId>
        <version>${jetty.version}</version>
        <!-- we exclude all flagged jars so we can switch them for Glassfish -->
        <exclusions>
          <exclusion>
            <groupId>org.eclipse.jetty.orbit</groupId>
            <artifactId>javax.servlet</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.eclipse.jetty.orbit</groupId>
            <artifactId>javax.security.auth.message</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.eclipse.jetty.orbit</groupId>
            <artifactId>javax.annotation</artifactId>       
          </exclusion>
          <exclusion>
            <groupId>org.eclipse.jetty.orbit</groupId>
            <artifactId>javax.mail.glassfish</artifactId>        
          </exclusion>
        </exclusions>        
      </dependency>
      <dependency>
        <groupId>org.eclipse.jetty.orbit</groupId>
        <artifactId>javax.security.auth.message</artifactId>
        <version>1.0.0.v201108011116</version>
      </dependency>
      <dependency>
        <groupId>org.eclipse.jetty.orbit</groupId>
        <artifactId>javax.annotation</artifactId>
        <version>1.1.0.v201108011116</version>
      </dependency>
      <dependency>
        <groupId>org.eclipse.jetty.orbit</groupId>
        <artifactId>javax.mail.glassfish</artifactId>
        <version>1.4.1.v201005082020</version>
      </dependency>
      <dependency>
        <groupId>jline</groupId>
        <artifactId>jline</artifactId>
        <version>0.9.94</version>
        <exclusions>
          <exclusion>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
          </exclusion>
        </exclusions>        
      </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.guava</groupId>
        <artifactId>guava</artifactId>
        <version>13.0.1</version>
      </dependency>
      <dependency>
        <groupId>org.terracotta</groupId>
        <artifactId>management-core</artifactId>
        <version>${management-core-version}</version>
      </dependency>      
      <dependency>
        <groupId>org.terracotta</groupId>
        <artifactId>management-core-resources</artifactId>
        <version>${management-core-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>org.slf4j</groupId>
        <artifactId>jul-to-slf4j</artifactId>
        <version>${slf4j.version}</version>
      </dependency>
      <dependency>
        <groupId>hsqldb</groupId>
        <artifactId>hsqldb</artifactId>
        <version>1.7.2.2</version>
      </dependency>

      <!-- Glassfish substitutes -->
      <dependency>
        <groupId>gf-3122</groupId>
        <artifactId>gf.javax.servlet-api</artifactId>
        <version>3.0.1</version>
      </dependency>
      <dependency>
        <groupId>gf-3122</groupId>
        <artifactId>gf.javax.security.auth.message</artifactId>
        <version>1.0</version>
      </dependency>  
      <dependency>
        <groupId>gf-3122</groupId>
        <artifactId>gf.javax.annotation</artifactId>
        <version>1.1</version>
      </dependency>
      <dependency>
        <groupId>gf-3122</groupId>
        <artifactId>gf.javax.mail</artifactId>
        <version>1.4.4</version>
      </dependency>

      <!-- Dependencies for core Terracotta artifacts -->
      <dependency>
        <groupId>org.terracotta</groupId>
        <artifactId>tcconfig</artifactId>
        <version>${tcconfig.version}</version>
      </dependency>
      <dependency>
        <groupId>org.terracotta</groupId>
        <artifactId>tc-l1-reconnect-properties</artifactId>
        <version>${tcconfig.version}</version>
      </dependency>
      <dependency>
        <groupId>org.terracotta</groupId>
        <artifactId>tcstats</artifactId>
        <version>${tcconfig.version}</version>
      </dependency>

      <!-- tests -->
      <dependency>
        <groupId>com.thoughtworks.xstream</groupId>
        <artifactId>xstream</artifactId>
        <version>1.4.4</version>
      </dependency>
      <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.9.5</version>
      </dependency>
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.11</version>
      </dependency>
      <dependency>
        <groupId>org.powermock</groupId>
        <artifactId>powermock-module-junit4</artifactId>
        <version>${powermock.version}</version>
      </dependency>
      <dependency>
        <groupId>org.powermock</groupId>
        <artifactId>powermock-api-mockito</artifactId>
        <version>${powermock.version}</version>
      </dependency>
      <dependency>
        <groupId>org.hamcrest</groupId>
        <artifactId>hamcrest-all</artifactId>
        <version>${hamcrest.version}</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.mockito</groupId>
      <artifactId>mockito-all</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.ant</groupId>
      <artifactId>ant</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.terracotta.junit</groupId>
      <artifactId>test-listeners</artifactId>
      <version>1.0.1</version>
      <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.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>
                <properties>
                  <property>
                    <name>listener</name>
                    <value>net.sf.ehcache.SystemExitListener</value>
                  </property>
                </properties>              
                <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>
                <devLog>true</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>
        <!--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.1,)</versionRange>
                    <goals>
                      <goal>unpack-dependencies</goal>
                      <goal>list</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>system-tests</id>
      <properties>
        <should_skip_tests>false</should_skip_tests>
      </properties>
    </profile>

    <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.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>
              <failIfNoTests>false</failIfNoTests>
            </configuration>
          </plugin>
        </plugins>      
      </build>
    </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>jboss-public</id>
      <url>http://repository.jboss.org/nexus/content/groups/public</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>      
  </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>
    <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>
