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

    This file is part of choco, http://choco-solver.org/

    Copyright (c) 2023, IMT Atlantique. All rights reserved.

    Licensed under the BSD 4-clause license.

    See LICENSE file in the project root for full license information.

-->
<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>
    <groupId>org.choco-solver</groupId>
    <artifactId>choco</artifactId>
    <version>4.10.14</version>
    <packaging>pom</packaging>
    <name>choco</name>
    <url>http://choco-solver.org/</url>
    <description>
        A Free and Open-Source library dedicated to Constraint Programming.
    </description>

    <modules>
        <module>solver</module>
        <module>parsers</module>
        <module>examples</module>
    </modules>

    <dependencies>
        <dependency>
            <groupId>net.sf.trove4j</groupId>
            <artifactId>trove4j</artifactId>
            <version>3.0.3</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <version>2.0.5</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>7.5</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.choco-solver</groupId>
                <artifactId>choco-solver</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.choco-solver</groupId>
                <artifactId>choco-parsers</artifactId>
                <version>${project.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <scm>
        <connection>scm:git:git@github.com:chocoteam/choco-solver.git</connection>
        <url>scm:git:git://github.com/chocoteam/choco-solver</url>
        <developerConnection>scm:git:git@github.com:chocoteam/choco-solver.git</developerConnection>
        <tag>HEAD</tag>
    </scm>

    <licenses>
        <license>
            <name>BSD 4-Clause License</name>
            <url>https://spdx.org/licenses/BSD-4-Clause.html</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Charles Prud'homme</name>
            <email>charles.prudhomme@mimt-atlantique.fr</email>
            <organization>TASC, LS2N CNRS UMR 6241</organization>
            <organizationUrl>https://www.ls2n.fr/equipe/tasc/?lang=en</organizationUrl>
            <url>https://cprudhom.github.io</url>
        </developer>
        <developer>
            <name>Jean-Guillaume Fages</name>
            <email>jg.fages@cosling.com</email>
            <organization>COSLING S.A.S.</organization>
            <organizationUrl>http://www.cosling.com</organizationUrl>
        </developer>
        <developer>
            <name>Arthur Godet</name>
            <email>arth.godet@gmail.com</email>
            <organization>TASC, LS2N CNRS UMR 6241</organization>
            <organizationUrl>https://www.imt-atlantique.fr/fr/recherche-et-innovation/laboratoires/ls2n
            </organizationUrl>
        </developer>
    </developers>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.build.timestamp.format>yyyy</maven.build.timestamp.format>
        <main_dir>./</main_dir>
    </properties>

    <profiles>
        <profile>
            <id>ossrhDeploy</id>
            <distributionManagement>
                <repository>
                    <id>ossrh</id>
                    <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
                </repository>
                <snapshotRepository>
                    <id>ossrh</id>
                    <url>https://oss.sonatype.org/content/repositories/snapshots</url>
                    <layout>default</layout>
                    <uniqueVersion>true</uniqueVersion>
                </snapshotRepository>
            </distributionManagement>
            <activation>
                <activeByDefault>false</activeByDefault>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <!-- We need the GPG Plugin to self-sign the jar files. A valid signature
                        for the jar files is a requirement for deploying to Maven Central. -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>3.0.1</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>3.4.1</version>
                        <configuration>
                            <doctitle>${project.groupId}-${project.artifactId} ${project.version} API</doctitle>
                            <windowtitle>${project.groupId}-${project.artifactId} ${project.version} API</windowtitle>
                            <!--<quiet />-->
                            <doclint>none</doclint>
                        </configuration>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>githubDeploy</id>
            <distributionManagement>
                <repository>
                    <id>github</id>
                    <name>GitHub Packages</name>
                    <url>https://maven.pkg.github.com/chocoteam/choco-solver</url>
                </repository>
            </distributionManagement>
        </profile>
        <profile>
            <id>coverage</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <version>0.8.10</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>prepare-agent</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>report</id>
                                <phase>prepare-package</phase>
                                <goals>
                                    <goal>report</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>dev</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
        </profile>
        <profile>
            <id>noIbex</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>3.0.0-M7</version>
                        <configuration>
                            <groups>1s,10s,checker</groups>
                            <disableXmlReport>true</disableXmlReport>
                            <statelessTestsetReporter>disable</statelessTestsetReporter>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.10.1</version>
                    <executions>
                        <execution>
                            <id>default-compile</id>
                            <configuration>
                                <!-- compile everything to ensure module-info contains right entries -->
                                <release>9</release>
                            </configuration>
                        </execution>
                        <execution>
                            <id>base-compile</id>
                            <goals>
                                <goal>compile</goal>
                            </goals>
                            <!-- recompile everything for target VM except the module-info.java -->
                            <configuration>
                                <excludes>
                                    <exclude>module-info.java</exclude>
                                </excludes>
                            </configuration>
                        </execution>
                    </executions>
                    <!-- defaults for compile and testCompile -->
                    <configuration>
                        <encoding>UTF-8</encoding>
                        <showDeprecation>true</showDeprecation>
                        <showWarnings>true</showWarnings>
                        <!-- Only required when JAVA_HOME isn't at least Java 9 and when haven't configured the maven-toolchains-plugin -->
                        <jdkToolchain>
                            <version>9</version>
                        </jdkToolchain>
                        <release>8</release>
                    </configuration>
                </plugin>
                <plugin>
                    <!-- see http://www.mojohaus.org/extra-enforcer-rules/enforceBytecodeVersion.html -->
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>3.1.0
                    </version> <!-- find the latest version at http://maven.apache.org/plugins/maven-enforcer-plugin/ -->
                    <executions>
                        <execution>
                            <id>enforce-bytecode-version</id>
                            <goals>
                                <goal>enforce</goal>
                            </goals>
                            <configuration>
                                <rules>
                                    <enforceBytecodeVersion>
                                        <maxJdkVersion>1.8</maxJdkVersion>
                                    </enforceBytecodeVersion>
                                </rules>
                                <fail>true</fail>
                            </configuration>
                        </execution>
                    </executions>
                    <dependencies>
                        <dependency>
                            <groupId>org.codehaus.mojo</groupId>
                            <artifactId>extra-enforcer-rules</artifactId>
                            <version>1.6.1</version>
                        </dependency>
                        <dependency>
                            <groupId>org.apache.maven.shared</groupId>
                            <artifactId>maven-dependency-tree</artifactId>
                            <version>3.2.1</version>
                        </dependency>
                    </dependencies>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <version>3.2.0</version>
                    <configuration>
                        <configLocation>checkstyle.xml</configLocation>
                        <outputEncoding>UTF-8</outputEncoding>
                        <consoleOutput>false</consoleOutput>
                        <failsOnError>false</failsOnError>
                        <linkXRef>false</linkXRef>
                        <excludes>**/module-info.java</excludes>
                        <violationIgnore>AtclauseOrder,
                            InvalidJavadocPosition,
                            JavadocBlockTagLocation,
                            JavadocContentLocation,
                            JavadocMethod,
                            JavadocPackage,
                            JavadocParagraph,
                            JavadocStyle,
                            JavadocTagContinuationIndentation,
                            JavadocType,
                            JavadocVariable,
                            MissingJavadocMethod,
                            MissingJavadocPackage,
                            MissingJavadocType,
                            NonEmptyAtclauseDescription,
                            SingleLineJavadoc,
                            SummaryJavadoc,
                            WriteTag
                        </violationIgnore>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>com.puppycrawl.tools</groupId>
                            <artifactId>checkstyle</artifactId>
                            <version>10.6.0</version>
                        </dependency>
                    </dependencies>
                    <executions>
                        <execution>
                            <id>validate</id>
                            <phase>validate</phase>
                            <goals>
                                <goal>check</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>3.1.0</version>
                <executions>
                    <execution>
                        <id>enforce-maven</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireMavenVersion>
                                    <version>3.1.1</version>
                                </requireMavenVersion>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.13</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>4.1</version>
                <configuration>
                    <header>${main_dir}/etc/header.txt</header>
                    <!--<header>LICENSE</header>-->
                    <properties>
                        <year>${maven.build.timestamp}</year>
                        <owner>IMT Atlantique</owner>
                        <project>${project.artifactId}</project>
                        <prurl>${project.url}</prurl>
                    </properties>
                    <mapping>
                        <template>JAVADOC_STYLE</template>
                        <java>SLASHSTAR_STYLE</java>
                    </mapping>
                    <includes>
                        <include>**/*.java</include>
                        <include>**/*.template</include>
                        <include>**/pom.xml</include>
                    </includes>
                </configuration>
                <executions>
                    <execution>
                        <phase>compile</phase>
                        <goals>
                            <goal>format</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.2.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.4.1</version>
                <configuration>
                    <doclint>none</doclint>
                    <sourceFileExcludes>
                        <sourceFileExclude>module-info.java</sourceFileExclude>
                    </sourceFileExcludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.8.10</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>report</id>
                        <phase>test</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

    <!-- =============================================================== -->
    <!-- Managing reports -->
    <!-- =============================================================== -->
    <reporting>
        <plugins>
            <!-- ===== Report on general information on the projet ===== -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <version>3.4.1</version>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>index</report>
                            <report>summary</report>
                            <report>plugins</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
            <!-- ===== Report on tests ===== -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-report-plugin</artifactId>
                <version>2.22.2</version>
                <configuration>
                    <linkXRef>false</linkXRef>
                </configuration>
                <!-- reportSet aggregating reports of modules -->
                <reportSets>
                    <reportSet>
                        <id>aggregate</id>
                        <reports>
                            <report>report</report>
                        </reports>
                        <!-- do not execute this reportSet in modules -->
                        <inherited>false</inherited>
                        <configuration>
                            <aggregate>true</aggregate>
                        </configuration>
                    </reportSet>

                    <!-- non-aggregated report to be executed in modules -->
                    <reportSet>
                        <id>modules</id>
                        <!-- execute this reportSet in modules -->
                        <inherited>true</inherited>
                        <reports>
                            <report>report</report>
                        </reports>
                        <configuration>
                            <aggregate>false</aggregate>
                        </configuration>
                    </reportSet>
                </reportSets>
            </plugin>
            <!-- ===== Report on code coverage analysis by Jacoco ===== -->
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.8.10</version>
                <reportSets>
                    <reportSet>
                        <reports>
                            <!-- select non-aggregate reports -->
                            <report>report</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
            <!-- ===== Report on code analysis by Checkstyle ===== -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>3.2.0</version>
                <configuration>
                    <configLocation>checkstyle.xml</configLocation>
                    <outputEncoding>UTF-8</outputEncoding>
                    <consoleOutput>false</consoleOutput>
                    <failsOnError>false</failsOnError>
                    <linkXRef>false</linkXRef>
                    <excludes>**/module-info.java</excludes>
                    <violationIgnore>AtclauseOrder,
                        InvalidJavadocPosition,
                        JavadocBlockTagLocation,
                        JavadocContentLocation,
                        JavadocMethod,
                        JavadocPackage,
                        JavadocParagraph,
                        JavadocStyle,
                        JavadocTagContinuationIndentation,
                        JavadocType,
                        JavadocVariable,
                        MissingJavadocMethod,
                        MissingJavadocPackage,
                        MissingJavadocType,
                        NonEmptyAtclauseDescription,
                        SingleLineJavadoc,
                        SummaryJavadoc,
                        WriteTag
                    </violationIgnore>
                </configuration>
                <reportSets>
                    <!-- reportSet executed in all modules -->
                    <reportSet>
                        <reports>
                            <report>checkstyle</report>
                        </reports>
                    </reportSet>
                    <!-- reportSet aggregating reports of modules -->
                    <reportSet>
                        <id>checkstyle-aggregate</id>
                        <inherited>false</inherited>
                        <configuration>
                            <skipExec>true</skipExec>
                        </configuration>
                        <reports>
                            <report>checkstyle-aggregate</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
            <!-- ===== Generating Javadoc ===== -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.4.1</version>
                <configuration>
                    <doclint>none</doclint>
                    <source>8</source>
                    <!--                    <sourceFileExcludes>-->
                    <!--                        <sourceFileExclude>module-info.java</sourceFileExclude>-->
                    <!--                    </sourceFileExcludes>-->
                </configuration>
                <reportSets>
                    <!-- reportSet executed in all modules -->
                    <reportSet>
                        <reports>
                            <report>javadoc</report>
                        </reports>
                    </reportSet>
                    <!-- reportSet aggregating reports of modules -->
                    <reportSet>
                        <id>aggregate</id>
                        <inherited>false</inherited>
                        <reports>
                            <report>aggregate</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
        </plugins>
    </reporting>

</project>
