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

  <parent>
    <groupId>net.sf.ehcache</groupId>
    <artifactId>ehcache-root</artifactId>
    <version>2.10.0</version>
  </parent>

  <groupId>com.hynnet</groupId>
  <artifactId>ehcache-core</artifactId>
  <packaging>jar</packaging>

  <name>ehcache-core for jdk 1.5</name>
  <description>Internal ehcache-core module. This artifact is not meant to be used directly for jdk 1.5</description>

  <properties>
    <product.name>Ehcache</product.name>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <net.sf.ehcache.speedAdjustmentFactor>5</net.sf.ehcache.speedAdjustmentFactor>
    <testDir>src/test/java</testDir>
    <testResources>src/test/resources</testResources>
    <name>ehcache</name>
    <skipCheckstyle>false</skipCheckstyle>
    <tests.supplemental.args/>
    <tests.max.heap.size>-Xmx64m</tests.max.heap.size>
  </properties>

  <dependencies>
    <!--Required scope -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.terracotta.internal</groupId>
      <artifactId>statistics</artifactId>
    </dependency>

    <!-- Provided scope. This one, or another implementation
      must be provided. -->
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>javax.servlet-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.hibernate</groupId>
      <artifactId>hibernate-core</artifactId>
    </dependency>
    <dependency>
      <groupId>javax.transaction</groupId>
      <artifactId>jta</artifactId>
    </dependency>
    <dependency>
      <groupId>net.sf.ehcache</groupId>
      <artifactId>sizeof-agent</artifactId>
    </dependency>

    <!-- Test scope -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-jdk14</artifactId>
    </dependency>
    <dependency>
      <groupId>org.codehaus.btm</groupId>
      <artifactId>btm</artifactId>
    </dependency>
    <dependency>
      <groupId>net.sf.hibernate</groupId>
      <artifactId>hibernate</artifactId>
    </dependency>
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-core</artifactId>
    </dependency>
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-library</artifactId>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
    </dependency>
    <dependency>
      <groupId>dom4j</groupId>
      <artifactId>dom4j</artifactId>
    </dependency>
    <dependency>
      <groupId>javassist</groupId>
      <artifactId>javassist</artifactId>
    </dependency>
    <dependency>
      <groupId>org.hibernate</groupId>
      <artifactId>hibernate-ehcache</artifactId>
    </dependency>
    <dependency>
      <!-- Needed by net.sf.ehcache.hibernate.HibernateAPIUsageTest.testAPIAsUsedByHibernate2() -->
      <groupId>commons-logging</groupId>
      <artifactId>commons-logging</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.derby</groupId>
      <artifactId>derby</artifactId>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
    </dependency>
    <dependency>
      <groupId>com.sun.xsom</groupId>
      <artifactId>xsom</artifactId>
    </dependency>
    <dependency>
      <groupId>org.beanshell</groupId>
      <artifactId>bsh</artifactId>
    </dependency>
  </dependencies>

  <build>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
      </resource>
      <resource>
        <directory>${project.build.directory}/generated-resources</directory>
        <filtering>false</filtering>
      </resource>
    </resources>
    <testSourceDirectory>${basedir}/${testDir}</testSourceDirectory>
    <testResources>
      <testResource>
        <directory>${basedir}/src/main/config/jcache</directory>
      </testResource>
      <testResource>
        <directory>${basedir}/${testResources}</directory>
      </testResource>
    </testResources>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
          <execution>
            <id>test-jar</id>
            <goals>
              <goal>test-jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.terracotta</groupId>
        <artifactId>maven-forge-plugin</artifactId>
        <executions>
          <execution>
            <id>build-info</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>buildinfo</goal>
            </goals>
            <configuration>
              <rootPath>${basedir}/..</rootPath>
            </configuration>
          </execution>
        </executions>
      </plugin>



      <plugin>
        <groupId>org.terracotta</groupId>
        <artifactId>maven-forge-plugin</artifactId>
        <configuration>
          <forkMode>pertest</forkMode>
          <argLine>${tests.supplemental.args} ${tests.max.heap.size}</argLine>
          <childDelegation>false</childDelegation>
          <disableXmlReport>false</disableXmlReport>
          <printSummary>true</printSummary>
          <reportFormat>plain</reportFormat>
          <redirectTestOutputToFile>false</redirectTestOutputToFile>
          <systemPropertyVariables>
            <net.sf.ehcache.skipUpdateCheck>true</net.sf.ehcache.skipUpdateCheck>
            <java.awt.headless>true</java.awt.headless>
            <net.sf.ehcache.speedAdjustmentFactor>${net.sf.ehcache.speedAdjustmentFactor}</net.sf.ehcache.speedAdjustmentFactor>
            <java.io.tmpdir>${project.build.directory}</java.io.tmpdir>
          </systemPropertyVariables>
          <classpathDependencyExcludes>
            <classpathDependencyExclude>net.sf.ehcache:sizeof-agent</classpathDependencyExclude>
          </classpathDependencyExcludes>
        </configuration>
        <executions>
          <execution>
            <!-- The default-test execution is automatically bound to the test phase by Surefire -->
            <id>default-test</id>
            <configuration>
              <excludes>
                <exclude>**/*$*</exclude>
                <exclude>**/*PerfTest.java</exclude>
                <exclude>**/*PerfTest*.java</exclude>
                <exclude>**/Abstract*Test.java</exclude>
              </excludes>
            </configuration>
          </execution>
          <execution>
            <id>integration-test-execution</id>
            <phase>integration-test</phase>
            <goals>
              <goal>test</goal>
            </goals>
            <configuration>
              <skip>${checkshort}</skip> <!-- don't run these when check-short profile is on -->
              <failIfNoTests>false</failIfNoTests>
              <excludes>
                <exclude>**/*$*</exclude>
              </excludes>
              <includes>
               <include>**/IT*.java</include>
               <include>**/*IT.java</include>
               <include>**/*ITCase.java</include>
              </includes>
              <argLine>${tests.supplemental.args} -Xms512m -Xmx512m</argLine>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <executions>
          <execution>
            <phase>verify</phase>
            <goals>
              <goal>checkstyle</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <configLocation>${basedir}/checkstyle/checkstyle.xml</configLocation>
          <suppressionsLocation>${basedir}/checkstyle/suppressions.xml</suppressionsLocation>
          <headerLocation>${basedir}/checkstyle/ClassHeader.txt</headerLocation>
          <skip>${skipCheckstyle}</skip>
          <enableRSS>false</enableRSS>
          <linkXRef>false</linkXRef>
          <consoleOutput>true</consoleOutput>
          <failsOnError>true</failsOnError>
          <failOnViolation>true</failOnViolation>
          <includeTestSourceDirectory>false</includeTestSourceDirectory>
          <enableRulesSummary>true</enableRulesSummary>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <phase>generate-resources</phase>
            <id>copy-agent-jar-to-resources</id>
            <goals>
              <goal>copy-dependencies</goal>
            </goals>
            <configuration>
              <excludeArtifactIds>*</excludeArtifactIds>
              <includeArtifactIds>sizeof-agent</includeArtifactIds>
              <outputDirectory>${project.build.directory}/generated-resources/net/sf/ehcache/pool/sizeof/</outputDirectory>
              <stripVersion>true</stripVersion>
              <excludeTransitive>true</excludeTransitive>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>rmic-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>rmi-compilation</id>
            <phase>compile</phase>
            <goals>
              <goal>rmic</goal>
            </goals>
            <configuration>
              <includes>
                <include>**/RMICachePeer.class</include>
              </includes>
              <outputDirectory>${project.build.outputDirectory}</outputDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
    <pluginManagement>
      <plugins>
        <!--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>xml-maven-plugin</artifactId>
                    <versionRange>[1.0,)</versionRange>
                    <goals>
                      <goal>transform</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore/>
                  </action>
                </pluginExecution>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <versionRange>[1.0,)</versionRange>
                    <goals>
                      <goal>copy-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>rmic-maven-plugin</artifactId>
                    <versionRange>[1.1,)</versionRange>
                    <goals>
                      <goal>rmic</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore/>
                  </action>
                </pluginExecution>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <versionRange>[2.7,)</versionRange>
                    <goals>
                      <goal>checkstyle</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore/>
                  </action>
                </pluginExecution>
              </pluginExecutions>
            </lifecycleMappingMetadata>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

  <profiles>
    <profile>
      <id>skip-ehcache-core-deploy</id>
      <properties>
        <skipDeploy>true</skipDeploy>
      </properties>
    </profile>
    <profile>
      <id>staging</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>deploy</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>perfTests</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.terracotta</groupId>
            <artifactId>maven-forge-plugin</artifactId>
            <executions>
              <execution>
                <!-- The default-test execution is automatically bound to the test phase by Surefire -->
                <id>default-test</id>
                <configuration>
                  <argLine>${tests.supplemental.args} -Xmx512m</argLine>
                  <includes>
                    <include>**/*PerfTest.java</include>
                    <include>**/*PerfTest*.java</include>
                  </includes>
                  <excludes>
                    <exclude>**/*$*</exclude>
                    <exclude>**/Abstract*Test.java</exclude>
                  </excludes>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <!-- This profile is here for triggering when another scm than svn
        is used (for example git). Instead of getting the version build number from
        svn we will use the build date and the user name. -->
      <id>buildnumber-git</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>buildnumber-maven-plugin</artifactId>
            <version>1.0-beta-3</version>
            <executions>
              <execution>
                <phase>generate-resources</phase>
                <goals>
                  <goal>create</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <doCheck>false</doCheck>
              <doUpdate>false</doUpdate>
              <format>{0,date,yyyy-MM-dd_HH-mm}_{1}</format>
              <items>
                <item>timestamp</item>
                <item>${user.name}</item>
              </items>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <!-- Prevent interruptible IO from being used on Solaris - MNK-1947 -->
    <profile>
      <id>no-interruptible-io-solaris</id>
      <activation>
        <property>
          <name>java.vendor</name>
          <value>Sun Microsystems Inc.</value>
        </property>
      </activation>
      <properties>
        <tests.supplemental.args>-XX:-UseVMInterruptibleIO</tests.supplemental.args>
      </properties>
    </profile>
    <profile>
      <id>enable-system-gc-jrockit</id>
      <activation>
        <property>
          <name>java.vm.name</name>
          <value>Oracle JRockit(R)</value>
        </property>
      </activation>
      <properties>
        <tests.supplemental.args>-XXfullSystemGC -Xverbose:systemgc</tests.supplemental.args>
      </properties>
    </profile>
    <profile>
      <id>ibmj9</id>
      <activation>
        <property>
          <name>java.vm.name</name>
          <value>IBM J9 VM</value>
        </property>
      </activation>
      <properties>
        <tests.supplemental.args>-Xenableexplicitgc</tests.supplemental.args>
        <tests.max.heap.size>-Xmx256m</tests.max.heap.size>
      </properties>
    </profile>

    <!-- Profile for running only nonstopcache tests -->
    <profile>
      <id>test-nonstopcache</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.terracotta</groupId>
            <artifactId>maven-forge-plugin</artifactId>
            <configuration>
              <includes>
                <include>**/nonstop/*Test.java</include>
              </includes>
              <excludes>
                <exclude>**/*$*</exclude>
              </excludes>
              <systemProperties>
                <property>
                  <name>net.sf.ehcache.skipUpdateCheck</name>
                  <value>true</value>
                </property>
                <property>
                  <name>java.awt.headless</name>
                  <value>true</value>
                </property>
              </systemProperties>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <!-- Profile for building ehcache skipping checkstyle -->
    <profile>
      <id>fast</id>
      <properties>
        <skipCheckstyle>true</skipCheckstyle>
      </properties>
    </profile>
  </profiles>

  <!-- The JBoss repository is only here to satisfy the 'provided' dependency
    on hibernate-core -->
  <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>

    <!--For Hibernate. Test only -->
    <repository>
      <id>jboss-releases</id>
      <url>http://repository.jboss.org/nexus/content/groups/public-jboss</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>

    <!--For xsom. Test only -->
    <repository>
      <id>Java.net Maven 2</id>
      <url>http://download.java.net/maven/2</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>
  </pluginRepositories>


</project>
