<?xml version="1.0" encoding="UTF-8"?>
<!--
  #%L
  ToPIA :: Persistence

  $Id: pom.xml 2719 2013-04-28 20:24:33Z maven-release $
  $HeadURL: http://svn.nuiton.org/svn/topia/tags/topia-2.8-rc-1/topia-persistence/pom.xml $
  %%
  Copyright (C) 2004 - 2010 CodeLutin
  %%
  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU Lesser General Public License as
  published by the Free Software Foundation, either version 3 of the
  License, or (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Lesser Public License for more details.

  You should have received a copy of the GNU General Lesser Public
  License along with this program.  If not, see
  <http://www.gnu.org/licenses/lgpl-3.0.html>.
  #L%
  -->

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

  <!-- ************************************************************* -->
  <!-- *** POM Relationships *************************************** -->
  <!-- ************************************************************* -->

  <parent>
    <groupId>org.nuiton</groupId>
    <artifactId>topia</artifactId>
    <version>2.8-rc-1</version>
  </parent>

  <groupId>org.nuiton.topia</groupId>
  <artifactId>topia-persistence</artifactId>

  <dependencies>

    <dependency>
      <groupId>org.nuiton</groupId>
      <artifactId>nuiton-utils</artifactId>
    </dependency>

    <dependency>
      <groupId>org.nuiton</groupId>
      <artifactId>nuiton-csv</artifactId>
    </dependency>

    <dependency>
      <groupId>org.nuiton.i18n</groupId>
      <artifactId>nuiton-i18n</artifactId>
    </dependency>

    <dependency>
      <groupId>org.nuiton.eugene</groupId>
      <artifactId>eugene</artifactId>
    </dependency>

    <dependency>
      <groupId>org.nuiton.eugene</groupId>
      <artifactId>eugene-java-templates</artifactId>
    </dependency>

    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
    </dependency>

    <dependency>
      <groupId>commons-collections</groupId>
      <artifactId>commons-collections</artifactId>
    </dependency>

    <dependency>
      <groupId>commons-beanutils</groupId>
      <artifactId>commons-beanutils</artifactId>
    </dependency>

    <dependency>
      <groupId>commons-logging</groupId>
      <artifactId>commons-logging</artifactId>
    </dependency>

    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
    </dependency>

    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
    </dependency>

    <dependency>
      <groupId>org.hibernate</groupId>
      <artifactId>hibernate-core</artifactId>
    </dependency>
    <dependency>
      <groupId>org.hibernate</groupId>
      <artifactId>hibernate-ehcache</artifactId>
    </dependency>

    <dependency>
      <groupId>javassist</groupId>
      <artifactId>javassist</artifactId>
    </dependency>

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
    </dependency>

    <!-- BD H2 for testing -->
    <dependency>
      <groupId>com.h2database</groupId>
      <artifactId>h2</artifactId>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
    </dependency>

    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-core</artifactId>
    </dependency>

    <dependency>
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId>
      <scope>test</scope>
    </dependency>

  </dependencies>

  <!-- ************************************************************* -->
  <!-- *** Project Information ************************************* -->
  <!-- ************************************************************* -->

  <name>ToPIA :: Persistence</name>
  <description>Hibernate based persistence module</description>

  <!-- ************************************************************* -->
  <!-- *** Build Settings ****************************************** -->
  <!-- ************************************************************* -->

  <packaging>jar</packaging>

  <build>

    <testResources>

      <testResource>
        <directory>${maven.gen.dir}/test-java</directory>
        <includes>
          <include>**/*.hbm.xml</include>
        </includes>
      </testResource>

      <testResource>
        <directory>${maven.src.dir}/test/resources</directory>
        <includes>
          <include>**/*.properties</include>
        </includes>
      </testResource>

      <testResource>
        <directory>${maven.src.dir}/test/java</directory>
        <includes>
          <include>**/*.hbm.xml</include>
        </includes>
      </testResource>

    </testResources>

    <plugins>

      <plugin>
        <groupId>org.nuiton.processor</groupId>
        <artifactId>processor-maven-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.nuiton.i18n</groupId>
        <artifactId>i18n-maven-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>parserJava</goal>
              <goal>gen</goal>
            </goals>
            <!-- restrict parsing beacause this is expensive -->
            <!-- if you want to parse more, add your package in includes -->
            <configuration>
              <treateDefaultEntry>false</treateDefaultEntry>
              <entries>
                <entry>
                  <basedir>${maven.src.dir}/main/java</basedir>
                  <includes>
                    <include>org/nuiton/topia/framework/*.java</include>
                  </includes>
                </entry>
              </entries>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <!-- expose new plexus components -->
      <plugin>
        <groupId>org.codehaus.plexus</groupId>
        <artifactId>plexus-component-metadata</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>generate-metadata</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.nuiton.eugene</groupId>
        <artifactId>eugene-maven-plugin</artifactId>
        <configuration>

        </configuration>
        <executions>
          <execution>
            <id>Test Generator</id>
            <phase>generate-test-sources</phase>
            <configuration>
              <testPhase>true</testPhase>
              <templates>
                org.nuiton.topia.generator.TopiaMetaTransformer,
                org.nuiton.eugene.java.JavaInterfaceTransformer,
                org.nuiton.eugene.java.JavaBeanTransformer,
                org.nuiton.topia.generator.EntityDTOTransformer,
                org.nuiton.topia.generator.BinderHelperTransformer,
                org.nuiton.topia.generator.QueryHelperTransformer
              </templates>
              <fullPackagePath>org.nuiton.topia</fullPackagePath>
              <defaultPackage>org.nuiton.topia</defaultPackage>
            </configuration>
            <goals>
              <goal>generate</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <!-- expose tests -->
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
          <execution>
            <id>attach-test</id>
            <goals>
              <goal>test-jar</goal>
            </goals>
          </execution>
        </executions>

      </plugin>
    </plugins>
  </build>

  <!-- ************************************************************* -->
  <!-- *** Build Environment  ************************************** -->
  <!-- ************************************************************* -->
  <profiles>

    <!-- perform only on a release stage when using the maven-release-plugin -->
    <profile>
      <id>release-profile</id>
      <activation>
        <property>
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>

      <build>
        <plugins>

          <!-- always expose tests source jar -->
          <plugin>
            <artifactId>maven-source-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-test-sources</id>
                <goals>
                  <goal>test-jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <!-- always expose tests javadoc jar -->
          <plugin>
            <artifactId>maven-javadoc-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-test-javadoc</id>
                <goals>
                  <goal>test-jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

        </plugins>
      </build>
    </profile>

    <profile>
      <id>run-its</id>
      <activation>
        <property>
          <name>performRelease</name>
          <value>true</value>
          <!-- Reuse this when MINVOKER-107 will be done (syas invoker 1.6 -->
          <!--name>maven.test.skip</name>
          <value>!false</value-->
        </property>
      </activation>
      <build>
        <defaultGoal>integration-test</defaultGoal>
        <plugins>
          <plugin>
            <artifactId>maven-invoker-plugin</artifactId>
            <configuration>
              <localRepositoryPath>
                ${basedir}/target/local-repo
              </localRepositoryPath>
              <settingsFile>src/it/settings.xml</settingsFile>
              <cloneProjectsTo>${project.build.directory}/its</cloneProjectsTo>
              <debug>${maven.verbose}</debug>
            </configuration>
            <executions>
              <execution>
                <id>integration-test</id>
                <goals>
                  <goal>install</goal>
                  <goal>run</goal>
                </goals>
                <phase>integration-test</phase>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <!-- reporting at release time -->
    <profile>
      <id>reporting</id>
      <activation>
        <property>
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>

      <reporting>
        <plugins>
          <plugin>
            <groupId>org.codehaus.plexus</groupId>
            <artifactId>plexus-maven-plugin</artifactId>
            <version>${plexusPluginVersion}</version>
          </plugin>

          <plugin>
            <artifactId>maven-invoker-plugin</artifactId>
            <version>${invokerPluginVersion}</version>
          </plugin>
        </plugins>
      </reporting>

    </profile>

  </profiles>

</project>
