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

<!--
  #%L
  Pollen
  %%
  Copyright (C) 2009 - 2026 Code Lutin
  %%
  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU Affero 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 Public License for more details.
  You should have received a copy of the GNU Affero General Public License
  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  #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>chorempom</artifactId>
        <version>11.19</version>
    </parent>

    <groupId>org.chorem</groupId>
    <artifactId>pollen</artifactId>
    <version>3.5.4-SNAPSHOT</version>
    <packaging>pom</packaging>

    <name>Pollen</name>
    <description>Application de vote Pollen</description>
    <url>https://doc.pollen.cl/</url>
    <inceptionYear>2009</inceptionYear>

    <licenses>
        <license>
            <name>GNU Affero General Public License version 3</name>
            <url>https://www.gnu.org/licenses/agpl-3.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <organization>
        <name>Code Lutin</name>
        <url>https://www.codelutin.com/</url>
    </organization>

    <modules>
        <module>pollen-votecounting</module>
        <module>pollen-persistence</module>
        <module>pollen-services</module>
        <module>pollen-rest-api</module>
    </modules>

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

    <properties>
        <javaVersion>25</javaVersion>
        <animal.sniffer.skip>true</animal.sniffer.skip>
        <gpg.skip>true</gpg.skip>

        <gitlabProjectName>pollen</gitlabProjectName>

        <maven.deploy.skip>false</maven.deploy.skip>

        <!-- Other plugin versions -->
        <git-commit-id-maven-plugin.version>9.0.2</git-commit-id-maven-plugin.version>
        <nuiton-maven-report-plugin.version>3.0.1</nuiton-maven-report-plugin.version>
        <openapi-generator-maven-plugin.version>7.21.0</openapi-generator-maven-plugin.version>

        <!-- Quarkus version -->
        <quarkus.version>3.34.1</quarkus.version>

        <!-- Nuiton dependencies -->
        <nuiton-csv.version>3.1</nuiton-csv.version>
        <nuiton-config.version>3.7</nuiton-config.version>
        <nuiton-i18n.version>4.2</nuiton-i18n.version>
        <nuiton-utils.version>3.1</nuiton-utils.version>

        <!-- Undefined in Quarkus bom or overridden -->
        <classgraph.version>4.8.184</classgraph.version>
        <commons-email2.version>2.0.0-M1</commons-email2.version>
        <hibernate.version>6.6.46.Final</hibernate.version>
        <java-jwt.version>4.5.0</java-jwt.version>
        <mapstruct.version>1.6.3</mapstruct.version>
        <mustache-compiler.version>0.9.14</mustache-compiler.version>
        <rome.version>2.1.0</rome.version>

        <!-- Test only dependencies -->
        <assertj.version>3.27.7</assertj.version>
        <fluent-hc.version>4.5.14</fluent-hc.version>
        <logback-classic.version>1.5.32</logback-classic.version>
        <yamlbeans.version>1.17</yamlbeans.version>

        <pollenI18nBundle>pollen-i18n</pollenI18nBundle>
        <!-- license to use  -->
        <license.licenseName>agpl_v3</license.licenseName>
        <license.excludes>**/i18n/*.properties,**/THIRD-PARTY.properties,**/*.sh,**/*.sql,**/*.json</license.excludes>

        <!-- no site generation -->
        <maven.site.skip>true</maven.site.skip>
        <maven.site.deploy.skip>true</maven.site.deploy.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>

    <repositories>

        <repository>
            <id>chorem-group</id>
            <name>Chorem Group</name>
            <url>https://nexus.nuiton.org/nexus/content/groups/pollen-group</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
            <releases>
                <enabled>true</enabled>
            </releases>
        </repository>

    </repositories>

    <pluginRepositories>

        <pluginRepository>
            <id>chorem-group</id>
            <name>Chorem Group</name>
            <url>https://nexus.nuiton.org/nexus/content/groups/pollen-group</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
            <releases>
                <enabled>true</enabled>
            </releases>
        </pluginRepository>

    </pluginRepositories>

    <dependencyManagement>
        <dependencies>

            <dependency>
                <groupId>io.quarkus</groupId>
                <artifactId>quarkus-universe-bom</artifactId>
                <version>${quarkus.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <!-- Emailing -->

            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-email2-core</artifactId>
                <version>${commons-email2.version}</version>
            </dependency>

            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-email2-jakarta</artifactId>
                <version>${commons-email2.version}</version>
            </dependency>

            <dependency>
                <groupId>org.hibernate.orm</groupId>
                <artifactId>hibernate-core</artifactId>
                <version>${hibernate.version}</version>
                <scope>runtime</scope>
                <exclusions>
                    <exclusion>
                        <groupId>org.hibernate.javax.persistence</groupId>
                        <artifactId>hibernate-jpa-2.0-api</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>

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

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

            <dependency>
                <groupId>com.contrastsecurity</groupId>
                <artifactId>yamlbeans</artifactId>
                <version>${yamlbeans.version}</version>
            </dependency>

            <!-- Nuiton libs -->

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

            <dependency>
                <groupId>org.nuiton</groupId>
                <artifactId>nuiton-config</artifactId>
                <version>${nuiton-config.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>commons-logging</groupId>
                        <artifactId>commons-logging</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>

            <dependency>
                <groupId>org.nuiton</groupId>
                <artifactId>nuiton-csv</artifactId>
                <version>${nuiton-csv.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>commons-logging</groupId>
                        <artifactId>commons-logging</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>

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

            <dependency>
                <groupId>io.github.classgraph</groupId>
                <artifactId>classgraph</artifactId>
                <version>${classgraph.version}</version>
                <scope>runtime</scope>
            </dependency>

            <!-- Jwt-java -->

            <dependency>
                <groupId>com.auth0</groupId>
                <artifactId>java-jwt</artifactId>
                <version>${java-jwt.version}</version>
            </dependency>

            <!-- Rome (rss) -->

            <dependency>
                <groupId>com.rometools</groupId>
                <artifactId>rome</artifactId>
                <version>${rome.version}</version>
            </dependency>

            <dependency>
                <groupId>com.github.spullara.mustache.java</groupId>
                <artifactId>compiler</artifactId>
                <version>${mustache-compiler.version}</version>
            </dependency>

            <dependency>
                <groupId>org.mapstruct</groupId>
                <artifactId>mapstruct</artifactId>
                <version>${mapstruct.version}</version>
            </dependency>

            <!-- Logging -->
            <dependency>
                <groupId>ch.qos.logback</groupId>
                <artifactId>logback-classic</artifactId>
                <version>${logback-classic.version}</version>
                <scope>test</scope>
            </dependency>

            <!-- Test -->
            <dependency>
                <groupId>org.assertj</groupId>
                <artifactId>assertj-core</artifactId>
                <version>${assertj.version}</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>org.apache.httpcomponents</groupId>
                <artifactId>fluent-hc</artifactId>
                <version>${fluent-hc.version}</version>
                <scope>test</scope>
                <exclusions>
                    <exclusion>
                        <groupId>commons-logging</groupId>
                        <artifactId>commons-logging</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
        <pluginManagement>
            <plugins>

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

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

                <plugin>
                    <artifactId>maven-project-info-reports-plugin</artifactId>
                    <version>${projectInfoReportsPluginVersion}</version>
                </plugin>

                <plugin>
                    <groupId>io.github.git-commit-id</groupId>
                    <artifactId>git-commit-id-maven-plugin</artifactId>
                    <version>${git-commit-id-maven-plugin.version}</version>
                </plugin>

                <plugin>
                    <groupId>io.quarkus</groupId>
                    <artifactId>quarkus-maven-plugin</artifactId>
                    <version>${quarkus.version}</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <configuration>
                        <annotationProcessorPaths>
                            <path>
                                <groupId>org.mapstruct</groupId>
                                <artifactId>mapstruct-processor</artifactId>
                                <version>${mapstruct.version}</version>
                            </path>
                        </annotationProcessorPaths>
                    </configuration>
                </plugin>

            </plugins>
        </pluginManagement>

        <plugins>
            <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>
            <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-enforcer-plugin</artifactId>
                <executions>
                    <execution>
                        <id>enforce-maven</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireMavenVersion>
                                    <version>3.9</version>
                                </requireMavenVersion>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>

        <profile>
            <id>reporting</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <reporting>
                <plugins>
                    <plugin>
                        <groupId>org.nuiton</groupId>
                        <artifactId>nuiton-maven-report-plugin</artifactId>
                        <version>${nuiton-maven-report-plugin.version}</version>
                        <reportSets>
                            <reportSet>
                                <reports>
                                    <report>aggregate-config-report</report>
                                </reports>
                            </reportSet>
                        </reportSets>
                        <configuration>
                            <i18nBundleName>${pollenI18nBundle}</i18nBundleName>
                        </configuration>
                    </plugin>
                    <plugin>
                        <artifactId>maven-project-info-reports-plugin</artifactId>
                        <version>${projectInfoReportsPluginVersion}</version>
                        <reportSets>
                            <reportSet>
                                <reports>
                                    <report>project-team</report>
                                    <report>mailing-list</report>
                                    <report>cim</report>
                                    <report>issue-tracking</report>
                                    <report>license</report>
                                    <report>scm</report>
                                    <report>dependency-convergence</report>
                                    <report>dependency-management</report>
                                </reports>
                            </reportSet>
                        </reportSets>
                    </plugin>
                </plugins>
            </reporting>
        </profile>

        <profile>
            <id>release-quality-profile</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <properties>
                <helper.skipCheckAutocontainer>true</helper.skipCheckAutocontainer>
            </properties>
        </profile>

    </profiles>

</project>
