<?xml version="1.0" encoding="UTF-8"?>
<!--

   All content copyright (c) 2003-2008 Terracotta, Inc.,
   except as may otherwise be noted in a separate copyright notice.
   All rights reserved.

-->
<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.forge</groupId>
      <artifactId>forge-parent</artifactId>
      <version>1.0.17</version>
   </parent>

   <groupId>org.terracotta.forge</groupId>
   <artifactId>tim-parent</artifactId>
   <version>1.5.1</version>
   <packaging>pom</packaging>

   <name>TIM Parent</name>
   <description>Parent POM for Terracotta config modules</description>

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

   <properties>
      <exec-maven-plugin.version>1.1</exec-maven-plugin.version>
      <forgeTags>Parent POM</forgeTags>
      <tc-api.range>1.2.1</tc-api.range>
      <tc-api.version>1.2.1</tc-api.version>
      <tc.version>3.2.1</tc.version>
      <tc-maven-plugin.version>1.5.1</tc-maven-plugin.version>
      <tc.tim-util.version>1.0.7</tc.tim-util.version>
      <tc.config>tc-config.xml</tc.config>
      <tc.bootjar>${project.build.directory}/dso-boot.jar</tc.bootjar>
      <bootclasspath>${tc.bootjar}</bootclasspath>
      <tc.tests.info.l2.startup.mode>internal</tc.tests.info.l2.startup.mode>
      <Bundle-RequiredExecutionEnvironment>J2SE-1.5</Bundle-RequiredExecutionEnvironment>
      <tc.tests.info.junit-test-timeout-inseconds>900</tc.tests.info.junit-test-timeout-inseconds>
      <surefire.version>2.4.3</surefire.version>
      <gmaven.version>1.0</gmaven.version>
      <surefire.argLine><![CDATA[-Xbootclasspath/p:${bootclasspath} -Dtc.base-dir=${project.build.directory} -Dtc.config=${tc.config} -Dcom.tc.l1.modules.repositories=file://${settings.localRepository} -Dtc.dso.globalmode=false -Dtc.tests.info.l2.startup.mode=${tc.tests.info.l2.startup.mode} -Dtc.tests.info.bootjars.normal=${tc.bootjar} -Dtc.tests.info.junit-test-timeout-inseconds=${tc.tests.info.junit-test-timeout-inseconds}]]></surefire.argLine>
   </properties>

   <scm>
      <connection>scm:svn:http://svn.terracotta.org/svn/forge/projects/tim-parent/tags/release-1.5.1</connection>
      <developerConnection>scm:svn:https://svn.terracotta.org/repo/forge/projects/tim-parent/tags/release-1.5.1</developerConnection>
      <url>http://svn.terracotta.org/svn/forge/projects/tim-parent/tags/release-1.5.1</url>
   </scm>

   <profiles>
      <profile>
         <id>workaround-windows-spaces</id>
         <properties>
            <surefire.argLine><![CDATA[-Xbootclasspath/p:'${bootclasspath}' -Dtc.base-dir='${project.build.directory}' -Dtc.config='${tc.config}' -Dcom.tc.l1.modules.repositories='file://${settings.localRepository}' -Dtc.dso.globalmode=false -Dtc.tests.info.l2.startup.mode=${tc.tests.info.l2.startup.mode} -Dtc.tests.info.bootjars.normal='${tc.bootjar}']]></surefire.argLine>
         </properties>
         <activation>
            <os>
               <family>windows</family>
            </os>
         </activation>
      </profile>
      <profile>
         <id>snapshot</id>
         <distributionManagement>
            <site>
               <id>forge-site</id>
               <name>Project Sites Server</name>
               <url>${tc.distributionManagement.site.url}</url>
            </site>
         </distributionManagement>
      </profile>
      <profile>
         <id>release</id>
         <distributionManagement>
            <site>
               <id>forge-site</id>
               <name>Project Sites Server</name>
               <url>${tc.distributionManagement.site.url}</url>
            </site>
         </distributionManagement>
      </profile>
   </profiles>

   <dependencyManagement>
      <dependencies>
         <dependency>
            <groupId>org.terracotta</groupId>
            <artifactId>terracotta</artifactId>
            <version>${tc.version}</version>
            <scope>provided</scope>
         </dependency>
         <dependency>
            <groupId>org.terracotta.api</groupId>
            <artifactId>tim-api</artifactId>
            <version>${tc-api.version}</version>
            <scope>provided</scope>
         </dependency>
         <dependency>
            <groupId>org.terracotta.api</groupId>
            <artifactId>terracotta-api</artifactId>
            <version>${tc-api.version}</version>
            <scope>provided</scope>
         </dependency>
         <dependency>
            <groupId>org.terracotta</groupId>
            <artifactId>tcconfig</artifactId>
            <version>${tc.version}</version>
         </dependency>
         <dependency>
            <groupId>org.terracotta</groupId>
            <artifactId>tc-l1-reconnect-properties</artifactId>
            <version>${tc.version}</version>
         </dependency>
         <dependency>
            <groupId>org.terracotta.api</groupId>
            <artifactId>test-api</artifactId>
            <version>${tc-api.version}</version>
         </dependency>
         <dependency>
            <groupId>org.terracotta.modules</groupId>
            <artifactId>tim-util</artifactId>
            <version>${tc.tim-util.version}</version>
         </dependency>
      </dependencies>
   </dependencyManagement>

   <dependencies>
      <dependency>
         <groupId>org.terracotta.modules</groupId>
         <artifactId>modules-base</artifactId>
         <version>${tc-api.range}</version>
      </dependency>
      <dependency>
         <groupId>org.terracotta.api</groupId>
         <artifactId>tim-api</artifactId>
         <version>${tc-api.version}</version>
      </dependency>
   </dependencies>

   <build>
      <resources>
         <resource>
            <directory>src/main/resources</directory>
            <filtering>true</filtering>
         </resource>
      </resources>
      <testResources>
         <testResource>
            <directory>src/test/resources</directory>
            <filtering>true</filtering>
         </testResource>
      </testResources>
      <pluginManagement>
         <plugins>
            <plugin>
               <!-- Use the groovy plugin to generate the properties file used by BasicTimInfo. -->
               <groupId>org.codehaus.groovy.maven</groupId>
               <artifactId>gmaven-plugin</artifactId>
               <version>${gmaven.version}</version>
               <executions>
                  <execution>
                     <phase>generate-resources</phase>
                     <goals>
                        <goal>execute</goal>
                     </goals>
                     <configuration>
                        <source><![CDATA[
                           String groupIdPath   = project.groupId.replaceAll(/\./, "/")
                           String propsFileName = project.artifactId + ".properties"
                           File   propsFileDir  = new File(project.basedir, "/target/classes/" + groupIdPath)
                           File   propsFile     = new File(propsFileDir, propsFileName)

                           propsFileDir.mkdirs()

                           propsFile.withWriter { out ->
                              out.writeLine("# This properties file was generated with the groovy-maven-plugin.")
                              out.writeLine("version = " + project.version)
                           }
                        ]]></source>
                     </configuration>
                  </execution>
               </executions>
            </plugin>
            <plugin>
               <groupId>org.terracotta.maven.plugins</groupId>
               <artifactId>tc-maven-plugin</artifactId>
               <version>${tc-maven-plugin.version}</version>
               <configuration>
                  <startServer>false</startServer>
                  <workingDirectory>${project.build.directory}</workingDirectory>
                  <numberOfNodes>1</numberOfNodes>
                  <overwriteBootjar>true</overwriteBootjar>
                  <terracottaProjectStatus>${terracotta.projectStatus}</terracottaProjectStatus>
                  <config>${tc.config}</config>
               </configuration>
               <executions>
                  <execution>
                     <phase>generate-resources</phase>
                     <goals>
                        <goal>manifest</goal>
                     </goals>
                     <configuration>
                        <bundleRequiredExecutionEnvironment>${Bundle-RequiredExecutionEnvironment}</bundleRequiredExecutionEnvironment>
                        <bundleCategory>Terracotta Integration Module</bundleCategory>
                        <bundleCopyright>Copyright (c) 2007 - 2008 Terracotta, Inc.</bundleCopyright>
                        <importPackage>org.terracotta.modules.configuration</importPackage>
                     </configuration>
                  </execution>
               </executions>
               <dependencies>
                  <dependency>
                     <groupId>org.terracotta.api</groupId>
                     <artifactId>tim-api</artifactId>
                     <version>${tc-api.version}</version>
                  </dependency>
                  <dependency>
                     <groupId>org.terracotta</groupId>
                     <artifactId>tcconfig</artifactId>
                     <version>${tc.version}</version>
                  </dependency>
               </dependencies>
            </plugin>
            <plugin>
               <artifactId>maven-compiler-plugin</artifactId>
               <configuration>
                  <source>1.5</source>
                  <target>1.5</target>
               </configuration>
            </plugin>
            <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-surefire-plugin</artifactId>
               <version>${surefire.version}</version>
               <configuration>
                  <forkMode>always</forkMode>
                  <forkedProcessTimeoutInSeconds>${tc.tests.info.junit-test-timeout-inseconds}</forkedProcessTimeoutInSeconds>
                  <useSystemClassLoader>true</useSystemClassLoader>
                  <argLine>${surefire.argLine}</argLine>
               </configuration>
            </plugin>
            <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-jar-plugin</artifactId>
               <executions>
                  <execution>
                     <id>default</id>
                     <goals>
                        <goal>jar</goal>
                     </goals>
                     <configuration>
                        <forceCreation>true</forceCreation>
                        <archive>
                           <manifestFile>${project.build.directory}/MANIFEST.MF</manifestFile>
                        </archive>
                     </configuration>
                  </execution>
               </executions>
            </plugin>
         </plugins>
      </pluginManagement>
      <plugins>
         <plugin>
            <groupId>org.terracotta.maven.plugins</groupId>
            <artifactId>tc-maven-plugin</artifactId>
         </plugin>
         <plugin>
            <!-- Use the groovy plugin to generate the properties file used by BasicTimInfo. -->
            <groupId>org.codehaus.groovy.maven</groupId>
            <artifactId>gmaven-plugin</artifactId>
         </plugin>
         <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>${exec-maven-plugin.version}</version>
         </plugin>
      </plugins>
   </build>

   <repositories>
      <repository>
         <id>terracotta-repository</id>
         <url>http://www.terracotta.org/download/reflector/maven2</url>
         <releases>
            <enabled>true</enabled>
         </releases>
         <snapshots>
            <enabled>true</enabled>
         </snapshots>
      </repository>
   </repositories>
   <pluginRepositories>
      <pluginRepository>
         <id>terracotta-repository</id>
         <url>http://www.terracotta.org/download/reflector/maven2</url>
         <releases>
            <enabled>true</enabled>
         </releases>
         <snapshots>
            <enabled>true</enabled>
         </snapshots>
      </pluginRepository>
   </pluginRepositories>
</project>
