<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>5.0</version>
    <relativePath />
  </parent>
  <name>ehcache-root</name>
  <groupId>net.sf.ehcache</groupId>
  <artifactId>ehcache-root</artifactId>
  <packaging>pom</packaging>
  <version>2.11.1-atlassian-1-m013</version>

  <scm>
    <developerConnection>scm:git:https://github.com/atlassian-forks/ehcache2.git</developerConnection>
    <tag>ehcache-root-2.11.1-atlassian-1-m013</tag>
  </scm>
  <properties>
    <jetty.version>10.0.16</jetty.version>
    <thirdparty-bom.version>4.4.0.5.17</thirdparty-bom.version>
    <terracotta-toolkit-api-internal.version>1.19</terracotta-toolkit-api-internal.version>
    <management-core.version>4.4.0.3.31</management-core.version>
    <clustered-entity-management.version>0.11.1</clustered-entity-management.version>
    <statistics.version>1.0.5</statistics.version>
    <quartz.version>2.2.3</quartz.version>
    <skipJavadoc>false</skipJavadoc>
    <groovy.version>4.0.5</groovy.version>
    <groovy-maven-plugin.version>2.1.1</groovy-maven-plugin.version>

    <!-- only used for plugins.  Keep in sync with terracotta-third-party-bom-4.x -->
    <!-- hardcoded because https://issues.apache.org/jira/browse/MNG-5588 -->
    <h2.version>2.1.210</h2.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>
      <dependency>
        <groupId>org.terracotta</groupId>
        <artifactId>thirdparty-bom-4.x</artifactId>
        <version>${thirdparty-bom.version}</version>
        <scope>import</scope>
        <type>pom</type>
      </dependency>
      <!-- Required dependencies -->
      <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>

      <!-- 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>

      <!-- Test dependencies -->

      <dependency>
        <groupId>org.quartz-scheduler</groupId>
        <artifactId>quartz</artifactId>
        <version>${quartz.version}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-gpg-plugin</artifactId>
          <version>1.4</version>
          <configuration>
            <skip>true</skip>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>3.3.0</version>
          <configuration>
            <archive>
              <manifest>
                <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
              </manifest>
            </archive>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>3.4.1</version>
          <configuration>
            <skip>${skipJavadoc}</skip>
            <source>8</source>
            <detectJavaApiLink>false</detectJavaApiLink>
            <doclint>none</doclint>
            <quiet>true</quiet>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-checkstyle-plugin</artifactId>
          <version>3.2.0</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-dependency-plugin</artifactId>
          <version>3.3.0</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>build-helper-maven-plugin</artifactId>
          <version>3.3.0</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-antrun-plugin</artifactId>
          <version>3.1.0</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>
            <trimStackTrace>false</trimStackTrace>
            <reuseForks>false</reuseForks>
            <jdk>
              <version>1.${java.test.version}</version>
              <vendor>${java.test.vendor}</vendor>
            </jdk>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-shade-plugin</artifactId>
          <version>3.4.0</version>
          <dependencies>
            <dependency>
              <groupId>org.terracotta.maven.plugins</groupId>
              <artifactId>terracotta-shader</artifactId>
              <version>2.0</version>
            </dependency>
          </dependencies>
        </plugin>
        <plugin>
          <groupId>org.codehaus.gmaven</groupId>
          <artifactId>groovy-maven-plugin</artifactId>
          <version>${groovy-maven-plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>rmic-maven-plugin</artifactId>
          <version>1.3</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.gmavenplus</groupId>
          <artifactId>gmavenplus-plugin</artifactId>
          <version>1.13.1</version>
          <executions>
            <!--
            Determine some dependency versions so we don't have to duplicate the BOM.
            BOM only provides a dependencyManagement section, but some plugins need
            to specify dependency details in their configuration.

            This will work for any project that declares these dependencies
            (when the dependency is not declared, the property value is '')
            -->
            <execution>
              <id>determine-dep-version</id>
              <phase>generate-resources</phase>
              <goals>
                <goal>execute</goal>
              </goals>
              <configuration>
                <scripts>
                  <script><![CDATA[
                    def find = {artifactId ->
                      project.artifacts.find{it.artifactId == artifactId}?.version ?: ''
                    }
                    def props = [
                            'slf4j.version'           : find('slf4j-api'),
                            'hibernate-core.version'  : find('hibernate-core')
                    ]
                    println "Resolved dependency versions: ${props}"
                    project.properties.putAll(props)
                    ]]></script>
                </scripts>
              </configuration>
            </execution>
          </executions>
          <dependencies>
            <dependency>
              <groupId>org.apache.groovy</groupId>
              <artifactId>groovy-all</artifactId>
              <version>${groovy.version}</version>
              <scope>runtime</scope>
              <type>pom</type>
            </dependency>
          </dependencies>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-assembly-plugin</artifactId>
          <version>3.4.2</version>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-gpg-plugin</artifactId>
        <version>1.4</version>
        <configuration>
          <skip>true</skip>
        </configuration>
      </plugin>
      <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>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
      </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.codehaus.gmavenplus</groupId>
            <artifactId>gmavenplus-plugin</artifactId>
            <executions>
              <execution>
                <phase>process-test-classes</phase>
                <goals>
                  <goal>execute</goal>
                </goals>
                <configuration>
                  <scripts>
                    <script><![CDATA[
                        new org.reflections.Reflections("net.sf.ehcache")
                            .save("${project.build.outputDirectory}/reflections.xml")
                    ]]></script>
                  </scripts>
                </configuration>
              </execution>
            </executions>
            <dependencies>
              <dependency>
                <groupId>org.reflections</groupId>
                <artifactId>reflections</artifactId>
                <version>0.9.12</version>
              </dependency>
              <dependency>
                <groupId>org.apache.groovy</groupId>
                <artifactId>groovy-all</artifactId>
                <version>${groovy.version}</version>
                <scope>runtime</scope>
                <type>pom</type>
              </dependency>
              <dependency>
                <groupId>org.dom4j</groupId>
                <artifactId>dom4j</artifactId>
                <version>2.1.3</version>
              </dependency>

            </dependencies>
          </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>
              <trimStackTrace>false</trimStackTrace>
            </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.13</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>https://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>atlassian-3rdparty</id>
      <url>https://packages.atlassian.com/maven/3rdparty</url>
    </repository>
    <snapshotRepository>
      <id>atlassian-3rdparty-snapshot</id>
      <url>https://packages.atlassian.com/maven/3rdparty-snapshot</url>
    </snapshotRepository>
  </distributionManagement>

  <!-- minimal set to find the parent -->
  <repositories>
    <repository>
      <id>terracotta-releases</id>
      <url>https://repo.terracotta.org/maven2</url>
    </repository>
  </repositories>
</project>
