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

<!--
  ~ This file is part of the Yildiz-Engine project, licenced under the MIT License  (MIT)
  ~
  ~  Copyright (c) 2019-2023 Grégory Van den Borre
  ~
  ~  More infos available: https://engine.yildiz-games.be
  ~
  ~  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
  ~  documentation files (the "Software"), to deal in the Software without restriction, including without
  ~  limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
  ~  of the Software, and to permit persons to whom the Software is furnished to do so,
  ~  subject to the following conditions:
  ~
  ~  The above copyright notice and this permission notice shall be included in all copies or substantial
  ~  portions of the Software.
  ~
  ~  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  ~  WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
  ~  OR COPYRIGHT  HOLDERS BE LIABLE FOR ANY CLAIM,
  ~  DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  ~  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE  SOFTWARE.
  ~
  -->

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

  <name>Yildiz-Engine Parent</name>
  <description>Project to hold the parent pom for all children projects.</description>
  <inceptionYear>2009</inceptionYear>
  <url>https://engine.yildiz-games.be</url>

  <groupId>be.yildiz-games</groupId>
  <artifactId>parent</artifactId>
  <version>6.0.2</version>

  <licenses>
    <license>
      <name>MIT License</name>
      <url>https://github.com/yildiz-online/parent/blob/develop/LICENSE</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <developers>
    <developer>
      <name>Grégory Van den Borre</name>
      <email>vandenborre.gregory@hotmail.fr</email>
      <url>https://github.com/yildiz-online</url>
    </developer>
  </developers>

  <issueManagement>
    <system>JIRA</system>
    <url>https://yildiz.atlassian.net</url>
  </issueManagement>

  <scm>
    <connection>scm:git:https://github.com/yildiz-online/parent</connection>
    <developerConnection>scm:git:https://github.com/yildiz-online/parent</developerConnection>
    <url>https://github.com/yildiz-online/parent</url>
  </scm>

  <packaging>pom</packaging>

  <properties>
    <java.version>21</java.version>

    <maven.compiler.source>${java.version}</maven.compiler.source>
    <maven.compiler.target>${java.version}</maven.compiler.target>
    <maven.compiler.release>${java.version}</maven.compiler.release>
    <maven.compiler.args></maven.compiler.args>

    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.resources.sourceEncoding>UTF-8</project.resources.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

    <maven.plugin.clean.version>3.4.1</maven.plugin.clean.version>
    <maven.plugin.compiler.version>3.14.0</maven.plugin.compiler.version>
    <maven.plugin.deploy.version>3.1.4</maven.plugin.deploy.version>
    <maven.plugin.failsafe.version>3.0.0-M5</maven.plugin.failsafe.version>
    <maven.plugin.install.version>3.1.4</maven.plugin.install.version>
    <maven.plugin.resources.version>3.3.1</maven.plugin.resources.version>
    <maven.plugin.site.version>3.21.0</maven.plugin.site.version>
    <maven.plugin.surefire.version>3.5.3</maven.plugin.surefire.version>
    <maven.plugin.verifier.version>1.1</maven.plugin.verifier.version>

    <maven.plugin.jar.version>3.4.2</maven.plugin.jar.version>
    <maven.plugin.source.version>3.3.1</maven.plugin.source.version>

    <maven.plugin.javadoc.version>3.11.2</maven.plugin.javadoc.version>
    <maven.plugin.javadoc.options></maven.plugin.javadoc.options>

    <maven.plugin.antrun.version>3.1.0</maven.plugin.antrun.version>
    <maven.plugin.assembly.version>3.7.1</maven.plugin.assembly.version>
    <maven.plugin.dependency.version>3.8.1</maven.plugin.dependency.version>
    <maven.plugin.enforcer.version>3.5.0</maven.plugin.enforcer.version>
    <maven.plugin.gpg.version>3.2.7</maven.plugin.gpg.version>
    <maven.plugin.release.version>3.1.1</maven.plugin.release.version>
    <maven.plugin.scm.version>2.1.0</maven.plugin.scm.version>

    <maven.plugin.sonar.version>5.1.0.4751</maven.plugin.sonar.version>
    <maven.plugin.jacoco.version>0.8.13</maven.plugin.jacoco.version>
    <maven.plugin.exec.version>3.5.0</maven.plugin.exec.version>
    <maven.plugin.build-helper.version>3.6.0</maven.plugin.build-helper.version>
    <maven.plugin.nexus.version>1.7.0</maven.plugin.nexus.version>
    <maven.plugin.version.version>2.18.0</maven.plugin.version.version>
    <sonar.binaries>${project.basedir}/target/classes</sonar.binaries>
    <dependency.junit.version>5.12.2</dependency.junit.version>
  </properties>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>build-helper-maven-plugin</artifactId>
          <version>${maven.plugin.build-helper.version}</version>
        </plugin>

        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>versions-maven-plugin</artifactId>
          <version>${maven.plugin.version.version}</version>
          <configuration>
            <outputFile>${basedir}/target/outdated-dependencies.txt</outputFile>
            <rulesUri>file://${basedir}/maven-version-rules.xml</rulesUri>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-clean-plugin</artifactId>
          <version>${maven.plugin.clean.version}</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>${maven.plugin.compiler.version}</version>
          <configuration>
            <compilerArgs>${maven.compiler.args}</compilerArgs>
            <jdkToolchain><version>${java.version}</version></jdkToolchain>
            <release>${maven.compiler.release}</release>
            <source>${maven.compiler.source}</source>
            <target>${maven.compiler.target}</target>
          </configuration>
          <executions>
            <execution>
              <id>default-compile</id>
              <phase>none</phase>
            </execution>
            <execution>
              <id>default-testCompile</id>
              <phase>none</phase>
            </execution>
            <execution>
              <id>java-compile</id>
              <phase>compile</phase>
              <goals> <goal>compile</goal> </goals>
            </execution>
            <execution>
              <id>java-test-compile</id>
              <phase>test-compile</phase>
              <goals> <goal>testCompile</goal> </goals>
            </execution>
          </executions>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>${maven.plugin.deploy.version}</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-install-plugin</artifactId>
          <version>${maven.plugin.install.version}</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-resources-plugin</artifactId>
          <version>${maven.plugin.resources.version}</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>${maven.plugin.surefire.version}</version>
          <configuration>
            <useSystemClassLoader>false</useSystemClassLoader>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-verifier-plugin</artifactId>
          <version>${maven.plugin.verifier.version}</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>${maven.plugin.jar.version}</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-site-plugin</artifactId>
          <version>${maven.plugin.site.version}</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-antrun-plugin</artifactId>
          <version>${maven.plugin.antrun.version}</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-assembly-plugin</artifactId>
          <version>${maven.plugin.assembly.version}</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-dependency-plugin</artifactId>
          <version>${maven.plugin.dependency.version}</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-release-plugin</artifactId>
          <version>${maven.plugin.release.version}</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-scm-plugin</artifactId>
          <version>${maven.plugin.scm.version}</version>
        </plugin>

        <plugin>
          <groupId>org.sonarsource.scanner.maven</groupId>
          <artifactId>sonar-maven-plugin</artifactId>
          <version>${maven.plugin.sonar.version}</version>
        </plugin>

        <plugin>
          <artifactId>exec-maven-plugin</artifactId>
          <groupId>org.codehaus.mojo</groupId>
          <version>${maven.plugin.exec.version}</version>
        </plugin>

        <plugin>
          <groupId>org.sonatype.central</groupId>
          <artifactId>central-publishing-maven-plugin</artifactId>
          <version>0.7.0</version>
          <extensions>true</extensions>
          <configuration>
            <publishingServerId>ossrh</publishingServerId>
            <autoPublish>true</autoPublish>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>${maven.plugin.source.version}</version>
          <executions>
            <execution>
              <id>attach-sources</id>
              <phase>verify</phase>
              <goals>
                <goal>jar</goal>
              </goals>
            </execution>
          </executions>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>${maven.plugin.javadoc.version}</version>
          <configuration>
            <excludePackageNames>*.generated.*</excludePackageNames>
            <quiet>true</quiet>
            <encoding>UTF-8</encoding>
            <additionalOptions>${maven.plugin.javadoc.options}</additionalOptions>
          </configuration>
          <executions>
            <execution>
              <id>attach-javadocs</id>
              <phase>verify</phase>
              <goals>
                <goal>jar</goal>
              </goals>
            </execution>
          </executions>
          <dependencies>
            <dependency>
              <groupId>org.ow2.asm</groupId>
              <artifactId>asm</artifactId>
              <version>9.8</version>
            </dependency>
          </dependencies>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-gpg-plugin</artifactId>
          <version>${maven.plugin.gpg.version}</version>
          <executions>
            <execution>
              <id>sign-artifacts</id>
              <phase>deploy</phase>
              <goals>
                <goal>sign</goal>
              </goals>
              <configuration>
                <gpgArguments>
                  <arg>--pinentry-mode</arg>
                  <arg>loopback</arg>
                </gpgArguments>
              </configuration>
            </execution>
          </executions>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-enforcer-plugin</artifactId>
          <version>${maven.plugin.enforcer.version}</version>
          <executions>
            <execution>
              <id>enforce-maven</id>
              <goals>
                <goal>enforce</goal>
              </goals>
              <configuration>
                <rules>
                  <requireMavenVersion>
                    <version>3.5.2</version>
                  </requireMavenVersion>
                  <requireReleaseDeps>
                    <onlyWhenRelease>true</onlyWhenRelease>
                    <message>Snapshot dependencies are not allowed in releases.</message>
                  </requireReleaseDeps>
                  <dependencyConvergence/>
                </rules>
              </configuration>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
    <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>${maven.plugin.jacoco.version}</version>
        <executions>
          <execution>
            <id>prepare-agent</id>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
          </execution>
          <execution>
            <id>report</id>
            <goals>
              <goal>report</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter-engine</artifactId>
        <version>${dependency.junit.version}</version>
      </dependency>
      <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter-params</artifactId>
        <version>${dependency.junit.version}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <profiles>
    <profile>
      <id>deploy-to-central</id>
      <activation>
        <property>
          <name>!maven.plugin.nexus.skip</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
          </plugin>
          <plugin>
            <groupId>org.sonatype.central</groupId>
            <artifactId>central-publishing-maven-plugin</artifactId>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-enforcer-plugin</artifactId>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
