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

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

  <groupId>org.jeudego.pairgoth</groupId>
  <artifactId>engine-parent</artifactId>
  <version>0.2</version>
  <packaging>pom</packaging>

  <!-- CB: Temporary add my repository, while waiting for SSE Java server module author to incorporate my PR or for me to fork it -->
  <repositories>
    <repository>
      <id>central</id>
      <url>https://repo.maven.apache.org/maven2</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </repository>
    <repository>
      <id>republicate.com</id>
      <url>https://republicate.com/maven2</url>
      <releases>
        <enabled>false</enabled>
      </releases>
      <snapshots>
      <enabled>true</enabled>
      </snapshots>
    </repository>
  </repositories>
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>11</maven.compiler.source>
    <maven.compiler.target>11</maven.compiler.target>

    <maven.assembly.plugin.version>3.6.0</maven.assembly.plugin.version>
    <maven.clean.plugin.version>3.2.0</maven.clean.plugin.version>
    <maven.compiler.plugin.version>3.11.0</maven.compiler.plugin.version>
    <maven.dependency.plugin.version>3.5.0</maven.dependency.plugin.version>
    <maven.deploy.plugin.version>3.1.1</maven.deploy.plugin.version>
    <maven.enforcer.plugin.version>3.3.0</maven.enforcer.plugin.version>
    <maven.failsafe.plugin.version>3.2.3</maven.failsafe.plugin.version>
    <maven.install.plugin.version>3.1.1</maven.install.plugin.version>
    <maven.jar.plugin.version>3.3.0</maven.jar.plugin.version>
    <maven.javadoc.plugin.version>3.5.0</maven.javadoc.plugin.version>
    <maven.resources.plugin.version>3.3.1</maven.resources.plugin.version>
    <maven.shade.plugin.version>3.4.1</maven.shade.plugin.version>
    <maven.source.plugin.version>3.3.0</maven.source.plugin.version>
    <maven.surefire.plugin.version>3.0.0</maven.surefire.plugin.version>
    <maven.war.plugin.version>3.3.2</maven.war.plugin.version>
    <license.plugin.version>4.2</license.plugin.version>
    <junit.jupiter.version>5.9.3</junit.jupiter.version>

    <servlet.api.version>4.0.4</servlet.api.version>
    <jetty.version>10.0.15</jetty.version>
    <slf4j.version>2.0.7</slf4j.version>

    <!-- kotlin -->
    <kotlin.version>1.9.22</kotlin.version>
    <kotlin.code.style>official</kotlin.code.style>
    <kotlin.compiler.jvmTarget>10</kotlin.compiler.jvmTarget>
    <kotlin.compiler.incremental>true</kotlin.compiler.incremental>

    <!-- pairgoth default properties -->
    <pairgoth.env>dev</pairgoth.env>
    <pairgoth.version>${project.version}</pairgoth.version>
    <pairgoth.webapp.protocol>http</pairgoth.webapp.protocol>
    <pairgoth.webapp.host>localhost</pairgoth.webapp.host>
    <pairgoth.webapp.port>8080</pairgoth.webapp.port>
    <pairgoth.webapp.context>/</pairgoth.webapp.context>
    <pairgoth.webapp.external.url>${pairgoth.webapp.protocol}://${pairgoth.webapp.host}:${pairgoth.webapp.port}/${pairgoth.webapp.context}</pairgoth.webapp.external.url>
    <pairgoth.api.protocol>http</pairgoth.api.protocol>
    <pairgoth.api.host>localhost</pairgoth.api.host>
    <pairgoth.api.port>8085</pairgoth.api.port>
    <pairgoth.api.context>/api</pairgoth.api.context>
    <pairgoth.api.external.url>${pairgoth.api.protocol}://${pairgoth.api.host}:${pairgoth.api.port}${pairgoth.api.context}</pairgoth.api.external.url>
    <pairgoth.store>file</pairgoth.store>
    <pairgoth.store.file.path>tournamentfiles</pairgoth.store.file.path>
    <pairgoth.auth>none</pairgoth.auth>
    <pairgoth.auth.sesame></pairgoth.auth.sesame>
    <pairgoth.smtp.sender></pairgoth.smtp.sender>
    <pairgoth.smtp.host></pairgoth.smtp.host>
    <pairgoth.smtp.port>587</pairgoth.smtp.port>
    <pairgoth.smtp.user></pairgoth.smtp.user>
    <pairgoth.smtp.password></pairgoth.smtp.password>
    <pairgoth.logger.level>info</pairgoth.logger.level>
    <pairgoth.logger.format>[%level] %ip [%logger] %message</pairgoth.logger.format>
  </properties>

  <modules>
    <module>api-webapp</module>
    <module>view-webapp</module>
    <module>webserver</module>
    <module>application</module>
  </modules>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-assembly-plugin</artifactId>
          <version>${maven.assembly.plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-clean-plugin</artifactId>
          <version>${maven.clean.plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>${maven.compiler.plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-dependency-plugin</artifactId>
          <version>${maven.dependency.plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>${maven.deploy.plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-enforcer-plugin</artifactId>
          <version>${maven.enforcer.plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-failsafe-plugin</artifactId>
          <version>${maven.failsafe.plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-install-plugin</artifactId>
          <version>${maven.install.plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>${maven.jar.plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>${maven.javadoc.plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-resources-plugin</artifactId>
          <version>${maven.resources.plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-shade-plugin</artifactId>
          <version>${maven.shade.plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>${maven.source.plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>${maven.surefire.plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-war-plugin</artifactId>
          <version>${maven.war.plugin.version}</version>
        </plugin>

        <plugin>
          <groupId>com.mycila</groupId>
          <artifactId>license-maven-plugin</artifactId>
          <version>${license.plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.jetbrains.kotlin</groupId>
          <artifactId>kotlin-maven-plugin</artifactId>
          <version>${kotlin.version}</version>
        </plugin>
        <plugin>
          <artifactId>properties-maven-plugin</artifactId>
          <groupId>org.codehaus.mojo</groupId>
          <version>1.2.1</version>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <executions>
          <execution>
            <id>enforce-java</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireMavenVersion>
                  <version>[3.0.0,)</version>
                </requireMavenVersion>
                <requireJavaVersion>
                  <version>[11,)</version>
                  <message>[ERROR] OLD JDK [${java.version}] in use.  This project requires JDK 11 or newer</message>
                </requireJavaVersion>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
