<?xml version="1.0" encoding="UTF-8"?>
<!--
  #%L
  ToPIA
  %%
  Copyright (C) 2004 - 2026 Code Lutin
  %%
  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>

  <parent>
    <groupId>org.nuiton</groupId>
    <artifactId>nuitonpom</artifactId>
    <version>11.19</version>
  </parent>

  <artifactId>topia</artifactId>
  <version>4.1-SNAPSHOT</version>
  <packaging>pom</packaging>

  <name>ToPIA</name>
  <description>
    Tools for Portable and Independent Architecture :
    Framework de persistance et de distribution d'application.
  </description>
  <url>https://topia.nuiton.org</url>
  <inceptionYear>2004</inceptionYear>

  <modules>
    <module>topia-persistence</module>
    <module>topia-junit</module>
    <module>topia-templates</module>
    <module>topia-it</module>
    <module>topia-service-replication</module>
    <module>topia-service-migration</module>
    <module>topia-service-flyway</module>
    <module>topia-service-liquibase</module>
    <module>topia-service-csv</module>
  </modules>

  <scm>
    <connection>scm:git:git@gitlab.nuiton.org:nuiton/topia.git</connection>
    <developerConnection>
      scm:git:git@gitlab.nuiton.org:nuiton/topia.git
    </developerConnection>
    <url>https://gitlab.nuiton.org/nuiton/topia</url>
  </scm>

  <properties>

    <!-- redmine project Id -->
    <projectId>topia</projectId>
    <gitlabProjectName>topia</gitlabProjectName>
    <!-- FIXME issues are no longer on redmine since migration to gitlab -->
    <redmine.skipGenerateChanges>true</redmine.skipGenerateChanges>

    <!-- libs version -->
    <commonsLoggingVersion>1.2</commonsLoggingVersion> <!-- Version 1.3.x breaks IT tests -->
    <eugeneVersion>3.0</eugeneVersion>
    <flywayVersion>12.3.0</flywayVersion>
    <guavaVersion>33.5.0-jre</guavaVersion>

    <h2Version>2.4.240</h2Version>

    <hamcrestVersion>3.0</hamcrestVersion>
    <hibernateVersion>6.6.46.Final</hibernateVersion>
    <jakartaPersistenceApiVersion>3.2.0</jakartaPersistenceApiVersion>
    <jrstPluginVersion>2.4</jrstPluginVersion>
    <junitVersion>4.13.2</junitVersion>
    <liquibaseVersion>4.33.0</liquibaseVersion>
    <log4jVersion>1.2.17</log4jVersion>
    <mockitoVersion>5.23.0</mockitoVersion>
    <nuitonUtilsVersion>3.0</nuitonUtilsVersion> <!-- Version 3.1+ requires migration of TopiaPagerBean -->
    <nuitonCsvVersion>3.1</nuitonCsvVersion>
    <nuitonDecoratorVersion>3.0</nuitonDecoratorVersion>
    <nuitonI18nVersion>4.2</nuitonI18nVersion>
    <processorPluginVersion>1.3</processorPluginVersion>
    <enforcerPluginVersion>3.4.1</enforcerPluginVersion>
    <sl4jVersion>1.7.36</sl4jVersion>

    <locales>fr</locales>

    <!-- no site generation -->
    <maven.site.skip>true</maven.site.skip>
    <maven.site.deploy.skip>true</maven.site.deploy.skip>

    <ciViewId>ToPIA</ciViewId>
    <javaVersion>17</javaVersion>
    <javadocJreApiVersion>17</javadocJreApiVersion>
    <animal.sniffer.skip>true</animal.sniffer.skip>

    <!-- Coverage Properties -->
    <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
    <sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
    <sonar.coverage.jacoco.xmlReportPaths>${project.basedir}/../target/site/jacoco-aggregate-all/jacoco.xml
    </sonar.coverage.jacoco.xmlReportPaths>
  </properties>

  <dependencyManagement>
    <dependencies>

      <dependency>
        <groupId>org.nuiton.eugene</groupId>
        <artifactId>eugene</artifactId>
        <version>${eugeneVersion}</version>
        <scope>provided</scope>
      </dependency>

      <dependency>
        <groupId>org.nuiton.eugene</groupId>
        <artifactId>eugene-java-templates</artifactId>
        <version>${eugeneVersion}</version>
        <scope>provided</scope>
      </dependency>

      <dependency>
        <groupId>org.nuiton</groupId>
        <artifactId>nuiton-utils</artifactId>
        <version>${nuitonUtilsVersion}</version>
      </dependency>

      <dependency>
        <groupId>org.nuiton</groupId>
        <artifactId>nuiton-csv</artifactId>
        <version>${nuitonCsvVersion}</version>
      </dependency>

      <dependency>
        <groupId>org.nuiton</groupId>
        <artifactId>nuiton-decorator</artifactId>
        <version>${nuitonDecoratorVersion}</version>
      </dependency>

      <dependency>
        <groupId>org.nuiton.i18n</groupId>
        <artifactId>nuiton-i18n</artifactId>
        <version>${nuitonI18nVersion}</version>
      </dependency>

      <dependency>
        <groupId>org.nuiton</groupId>
        <artifactId>nuiton-version</artifactId>
        <version>1.0</version>
      </dependency>

      <dependency>
        <groupId>org.hibernate.orm</groupId>
        <artifactId>hibernate-core</artifactId>
        <version>${hibernateVersion}</version>
      </dependency>

      <dependency>
        <groupId>org.hibernate.orm</groupId>
        <artifactId>hibernate-ant</artifactId>
        <version>${hibernateVersion}</version>
      </dependency>

      <dependency>
        <groupId>jakarta.persistence</groupId>
        <artifactId>jakarta.persistence-api</artifactId>
        <version>${jakartaPersistenceApiVersion}</version>
      </dependency>

      <dependency>
        <groupId>org.hibernate.orm</groupId>
        <artifactId>hibernate-c3p0</artifactId>
        <version>${hibernateVersion}</version>
        <scope>runtime</scope>
      </dependency>

      <dependency>
        <groupId>org.hibernate.orm</groupId>
        <artifactId>hibernate-hikaricp</artifactId>
        <version>${hibernateVersion}</version>
        <scope>runtime</scope>
      </dependency>

      <dependency>
        <groupId>org.flywaydb</groupId>
        <artifactId>flyway-core</artifactId>
        <version>${flywayVersion}</version>
      </dependency>

      <dependency>
        <groupId>org.liquibase</groupId>
        <artifactId>liquibase-core</artifactId>
        <version>${liquibaseVersion}</version>
      </dependency>

      <!-- hibernate-core only include api, need implementation,
           binding with log4j will be used
      -->
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${sl4jVersion}</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
        <version>${sl4jVersion}</version>
        <scope>test</scope>
      </dependency>

      <!-- Guava -->
      <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>${guavaVersion}</version>
      </dependency>

      <!-- Commons libs -->

      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-collections4</artifactId>
        <version>4.5.0</version>
      </dependency>

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

      <dependency>
        <groupId>commons-logging</groupId>
        <artifactId>commons-logging</artifactId>
        <version>${commonsLoggingVersion}</version>
      </dependency>

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

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

      <!-- BD H2 for testing -->
      <dependency>
        <groupId>com.h2database</groupId>
        <artifactId>h2</artifactId>
        <version>${h2Version}</version>
        <scope>test</scope>
      </dependency>

      <dependency>
        <groupId>org.hamcrest</groupId>
        <artifactId>hamcrest-core</artifactId>
        <version>${hamcrestVersion}</version>
        <scope>test</scope>
      </dependency>

      <dependency>
        <groupId>org.hamcrest</groupId>
        <artifactId>hamcrest</artifactId>
        <version>${hamcrestVersion}</version>
        <scope>test</scope>
      </dependency>

      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-core</artifactId>
        <version>${mockitoVersion}</version>
        <scope>test</scope>
      </dependency>

      <!-- Junit -->
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>${junitVersion}</version>
        <scope>test</scope>
      </dependency>

      <!-- Log4J -->
      <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>${log4jVersion}</version>
      </dependency>

      <!-- plexus -->
      <dependency>
        <groupId>org.codehaus.plexus</groupId>
        <artifactId>plexus-component-annotations</artifactId>
        <version>2.2.0</version>
      </dependency>

    </dependencies>
  </dependencyManagement>

  <build>

    <plugins>
      <!--For sonar code coverage-->
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>default-prepare-agent</id>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
          </execution>
          <execution>
            <id>default-report</id>
            <goals>
              <goal>report</goal>
            </goals>
          </execution>
          <execution>
            <id>jacoco-site-aggregate</id>
            <phase>verify</phase>
            <goals>
              <goal>report-aggregate</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>

    <pluginManagement>
      <plugins>

        <plugin>
          <groupId>org.nuiton.processor</groupId>
          <artifactId>processor-maven-plugin</artifactId>
          <version>${processorPluginVersion}</version>
          <executions>
            <execution>
              <phase>generate-sources</phase>
              <goals>
                <goal>process</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <includes>**/*.java</includes>
            <filters>
              org.nuiton.processor.filters.GeneratorTemplatesFilter,
              org.nuiton.processor.filters.ActiveLogsCodeFilter
            </filters>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.nuiton.eugene</groupId>
          <artifactId>eugene-maven-plugin</artifactId>
          <version>${eugeneVersion}</version>
          <configuration>
            <inputs>zargo</inputs>
            <resolver>org.nuiton.util.FasterCachedResourceResolver</resolver>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <configuration>
            <source>${javaVersion}</source>
            <detectJavaApiLink>false</detectJavaApiLink>
            <additionalOptions>
                <additionalOption>-Xdoclint:none</additionalOption>
            </additionalOptions>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.nuiton.i18n</groupId>
          <artifactId>i18n-maven-plugin</artifactId>
          <version>${nuitonI18nVersion}</version>
        </plugin>

        <plugin>
          <artifactId>maven-site-plugin</artifactId>
          <dependencies>
            <dependency>
              <groupId>org.nuiton.jrst</groupId>
              <artifactId>doxia-module-jrst</artifactId>
              <version>${jrstPluginVersion}</version>
            </dependency>
          </dependencies>
        </plugin>

        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>license-maven-plugin</artifactId>
          <configuration>
            <extraExtensions>
              <objectmodel>xml</objectmodel>
              <xsl>xml</xsl>
              <xsd>xml</xsd>
            </extraExtensions>
          </configuration>
        </plugin>

      </plugins>
    </pluginManagement>
  </build>

  <profiles>
    <!-- profile with all reports (include in release process) -->
    <profile>
      <id>reporting</id>
      <activation>
        <property>
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>

      <reporting>
        <plugins>

          <plugin>
            <artifactId>maven-project-info-reports-plugin</artifactId>
            <version>${projectInfoReportsPluginVersion}</version>
            <inherited>false</inherited>
            <reportSets>
              <reportSet>
                <reports>
                  <!-- see https://forge.nuiton.org/issues/3346 -->
                  <report>index</report>
                </reports>
              </reportSet>
            </reportSets>
          </plugin>
        </plugins>
      </reporting>
    </profile>
  </profiles>
</project>
