<?xml version="1.0" encoding="UTF-8"?>
<!--
  #%L
  Nuiton Utils
  %%
  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>nuiton-utils</artifactId>
  <version>3.2-SNAPSHOT</version>

  <name>Nuiton Utils</name>
  <description>Library of useful classes to be used in any project.</description>
  <url>https://nuiton.page.nuiton.org/nuiton-utils/</url>
  <inceptionYear>2004</inceptionYear>

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

  <properties>

    <gitlabProjectName>nuiton-utils</gitlabProjectName>

    <javaVersion>1.8</javaVersion>
    <signatureArtifactId>java18</signatureArtifactId>
    <signatureVersion>1.0</signatureVersion>

    <!-- Documentation is in apt format -->
    <siteSourcesType>apt</siteSourcesType>
    <locales>fr</locales>

    <!-- Pour garder la continuité des TAGs Git, on déclare explicitement le préfixe -->
    <gitflow.versionTagPrefix>nuiton-utils-</gitflow.versionTagPrefix>

    <!-- Coverage Properties -->
    <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
  </properties>

  <dependencies>

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

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

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

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

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

    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>33.5.0-jre</version>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.13.2</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-api</artifactId>
      <version>2.25.4</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-core</artifactId>
      <version>2.25.4</version>
      <scope>provided</scope>
    </dependency>

  </dependencies>

  <build>

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

      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <version>${assemblyPluginVersion}</version>
        <executions>
          <execution>
            <id>build-jar-with-dependencies</id>
            <goals>
              <goal>single</goal>
            </goals>
            <phase>package</phase>
            <configuration>
              <attach>true</attach>
              <descriptorRefs>
                <descriptorRef>jar-with-dependencies</descriptorRef>
              </descriptorRefs>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <!--For sonar code coverage-->
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>prepare-agent</id>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
          </execution>
          <execution>
            <id>report</id>
            <goals>
              <goal>report</goal>
            </goals>
            <configuration>
              <formats>
                <format>XML</format>
              </formats>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <artifactId>maven-dependency-plugin</artifactId>
        <inherited>true</inherited>
        <executions>
          <execution>
            <id>analyze</id>
            <goals>
              <goal>analyze-only</goal>
            </goals>
            <configuration>
              <verbose>true</verbose>
              <failOnWarning>true</failOnWarning>
              <ignoreNonCompile>true</ignoreNonCompile>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <!-- Required by org.nuiton.util.ResourceTest.testGetURLs -->
          <useSystemClassLoader>false</useSystemClassLoader>
        </configuration>
      </plugin>

    </plugins>
  </build>

  <profiles>

    <!-- create assemblies at release time -->
    <profile>
      <id>assembly-profile</id>
      <activation>
        <property>
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>
      <build>
        <defaultGoal>package</defaultGoal>
        <plugins>

          <!-- launch in a release the assembly automatically -->
          <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <executions>
              <execution>
                <id>create-assemblies</id>
                <phase>package</phase>
                <goals>
                  <goal>single</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <attach>false</attach>
              <descriptorRefs>
                <descriptorRef>deps</descriptorRef>
                <descriptorRef>full</descriptorRef>
              </descriptorRefs>
            </configuration>
          </plugin>

        </plugins>

      </build>
    </profile>

  </profiles>
</project>
