<!--
  ~ This file is part of the Yildiz-Engine project, licenced under the MIT License  (MIT)
  ~
  ~  Copyright (c) 2018 Grégory Van den Borre
  ~
  ~  More infos available: https://www.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>
  <groupId>be.yildiz-games</groupId>
  <artifactId>parent</artifactId>
  <version>2.2.5</version>

  <name>Yildiz Parent</name>
  <description>Project to hold the parent pom for all children projects.</description>
  <url>https://bitbucket.org/yildiz-engine-team/parent</url>

  <licenses>
    <license>
      <name>MIT License</name>
      <url>http://yildiz.bitbucket.org/licence.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <developers>
    <developer>
      <name>Gregory Van den Borre</name>
      <email>vandenborre.gregory@hotmail.fr</email>
      <url>https://bitbucket.org/yildiz/</url>
    </developer>
  </developers>

  <issueManagement>
    <system>JIRA</system>
    <url>https://yildiz.atlassian.net</url>
  </issueManagement>
  <scm>
    <connection>scm:git:https://bitbucket.org/yildiz-engine-team/parent</connection>
    <developerConnection>scm:git:https://bitbucket.org/yildiz-engine-team/parent</developerConnection>
    <url>https://bitbucket.org/yildiz-engine-team/parent</url>
  </scm>

  <packaging>pom</packaging>
  <inceptionYear>2009</inceptionYear>

  <properties>
    <java.version>9</java.version>

    <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.1.0</maven.plugin.clean.version>
    <maven.plugin.compiler.version>3.8.0</maven.plugin.compiler.version>
    <maven.plugin.deploy.version>2.8.2</maven.plugin.deploy.version>
    <maven.plugin.failsafe.version>2.19.1</maven.plugin.failsafe.version>
    <maven.plugin.install.version>2.5.2</maven.plugin.install.version>
    <maven.plugin.resources.version>3.1.0</maven.plugin.resources.version>
    <maven.plugin.site.version>3.7.1</maven.plugin.site.version>
    <maven.plugin.surefire.version>2.19.1</maven.plugin.surefire.version>
    <maven.plugin.verifier.version>1.1</maven.plugin.verifier.version>

    <maven.plugin.jar.version>3.1.0</maven.plugin.jar.version>
    <maven.plugin.source.version>3.0.1</maven.plugin.source.version>

    <maven.plugin.javadoc.version>3.0.1</maven.plugin.javadoc.version>

    <maven.plugin.antrun.version>1.8</maven.plugin.antrun.version>
    <maven.plugin.assembly.version>3.1.0</maven.plugin.assembly.version>
    <maven.plugin.dependency.version>3.1.1</maven.plugin.dependency.version>
    <maven.plugin.enforcer.version>1.4.1</maven.plugin.enforcer.version>
    <maven.plugin.gpg.version>1.6</maven.plugin.gpg.version>
    <maven.plugin.release.version>2.5.3</maven.plugin.release.version>
    <maven.plugin.scm.version>1.11.1</maven.plugin.scm.version>

    <maven.plugin.doxygen.version>1.1.0</maven.plugin.doxygen.version>
    <maven.plugin.doxygen.output>${project.build.outputDirectory}/doxygen</maven.plugin.doxygen.output>
    <maven.plugin.sonar.version>3.5.0.1254</maven.plugin.sonar.version>
    <maven.plugin.jacoco.version>0.8.2</maven.plugin.jacoco.version>
    <maven.plugin.exec.version>1.6.0</maven.plugin.exec.version>
    <maven.plugin.build-helper.version>3.0.0</maven.plugin.build-helper.version>
    <maven.plugin.pitest.version>1.4.3</maven.plugin.pitest.version>
    <maven.plugin.nexus.version>1.6.8</maven.plugin.nexus.version>
    <maven.plugin.nexus.serverId>ossrh</maven.plugin.nexus.serverId>
    <maven.plugin.nexus.nexusUrl>https://oss.sonatype.org/</maven.plugin.nexus.nexusUrl>
    <maven.plugin.nexus.autoReleaseAfterClose>true</maven.plugin.nexus.autoReleaseAfterClose>
    <maven.plugin.version.version>2.7</maven.plugin.version.version>
    <maven.plugin.jooq.version>3.11.7</maven.plugin.jooq.version>
    <maven.plugin.docker-image.version>1.4.9</maven.plugin.docker-image.version>
    <maven.plugin.owasp-dependency-check.version>3.3.4</maven.plugin.owasp-dependency-check.version>
    <sonar.binaries>${project.basedir}/target/classes</sonar.binaries>
    <sonar.junit.reportsPath>target/surefire-reports</sonar.junit.reportsPath>

    <dependency.junit.version>5.1.0</dependency.junit.version>
    <dependency.junit-platform.version>1.1.0</dependency.junit-platform.version>
    <dependency.mockito.version>2.23.4</dependency.mockito.version>
    <dependency.cucumber.version>4.2.0</dependency.cucumber.version>


  </properties>

  <prerequisites>
    <maven>3.5.3</maven>
  </prerequisites>

  <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>
            <jdkToolchain><version>${java.version}</version></jdkToolchain>
            <release>${java.version}</release>
            <source>${java.version}</source>
            <target>${java.version}</target>
          </configuration>
        </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-failsafe-plugin</artifactId>
          <version>${maven.plugin.failsafe.version}</version>
          <executions>
            <execution>
              <id>integration-tests</id>
              <goals>
                <goal>integration-test</goal>
                <goal>verify</goal>
              </goals>
            </execution>
          </executions>
        </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>
            <forkCount>1</forkCount>
            <reuseForks>false</reuseForks>
          </configuration>
          <dependencies>
            <dependency>
              <groupId>org.junit.platform</groupId>
              <artifactId>junit-platform-surefire-provider</artifactId>
              <version>${dependency.junit-platform.version}</version>
            </dependency>
            <dependency>
              <groupId>org.junit.jupiter</groupId>
              <artifactId>junit-jupiter-engine</artifactId>
              <version>${dependency.junit.version}</version>
            </dependency>
          </dependencies>
        </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>
          <groupId>org.jacoco</groupId>
          <artifactId>jacoco-maven-plugin</artifactId>
          <version>${maven.plugin.jacoco.version}</version>
        </plugin>

        <plugin>
          <groupId>com.soebes.maven.plugins</groupId>
          <artifactId>doxygen-maven-plugin</artifactId>
          <version>${maven.plugin.doxygen.version}</version>
          <configuration>
            <projectName>${project.name}</projectName>
            <projectNumber>${project.version}</projectNumber>
            <input>${project.build.sourceDirectory}</input>
            <optimizeOutputJava>true</optimizeOutputJava>
            <extractPrivate>true</extractPrivate>
            <extractStatic>true</extractStatic>
            <showFiles>false</showFiles>
            <sourceBrowser>false</sourceBrowser>
            <tabSize>4</tabSize>
            <htmlOutput>${maven.plugin.doxygen.output}</htmlOutput>
            <reportOutputDirectory>${maven.plugin.doxygen.output}</reportOutputDirectory>
            <haveDot>true</haveDot>
            <recursive>true</recursive>
            <generateTreeview>NONE</generateTreeview>
            <quiet>false</quiet>
            <callGraph>true</callGraph>
            <callerGraph>true</callerGraph>
            <extractAll>true</extractAll>
            <extractPrivate>true</extractPrivate>
            <extractStatic>true</extractStatic>
          </configuration>
        </plugin>

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

        <plugin>
          <groupId>org.sonatype.plugins</groupId>
          <artifactId>nexus-staging-maven-plugin</artifactId>
          <version>${maven.plugin.nexus.version}</version>
          <extensions>true</extensions>
          <configuration>
            <serverId>${maven.plugin.nexus.serverId}</serverId>
            <nexusUrl>${maven.plugin.nexus.nexusUrl}</nexusUrl>
            <autoReleaseAfterClose>${maven.plugin.nexus.autoReleaseAfterClose}</autoReleaseAfterClose>
          </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>
          </configuration>
          <executions>
            <execution>
              <id>attach-javadocs</id>
              <phase>verify</phase>
              <goals>
                <goal>jar</goal>
              </goals>
            </execution>
          </executions>
        </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>external.atlassian.jgitflow</groupId>
          <artifactId>jgitflow-maven-plugin</artifactId>
          <version>1.0-m5.1</version>
          <configuration>
            <flowInitContext>
              <masterBranchName>master</masterBranchName>
              <developBranchName>develop</developBranchName>
              <featureBranchPrefix>feature-</featureBranchPrefix>
              <releaseBranchPrefix>release-</releaseBranchPrefix>
              <hotfixBranchPrefix>hotfix-</hotfixBranchPrefix>
              <versionTagPrefix>version-</versionTagPrefix>
            </flowInitContext>
            <username>${env.GIT_USER}</username>
            <password>${env.GIT_PWD}</password>
            <noDeploy>true</noDeploy>
            <squash>true</squash>
            <scmCommentPrefix>[RELEASE] </scmCommentPrefix>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.jooq</groupId>
          <artifactId>jooq-codegen-maven</artifactId>
          <version>${maven.plugin.jooq.version}</version>
        </plugin>

        <plugin>
          <groupId>org.pitest</groupId>
          <artifactId>pitest-maven</artifactId>
          <version>${maven.plugin.pitest.version}</version>
          <configuration>
            <targetClasses>
              <param>be.yildizgames.*</param>
            </targetClasses>
            <targetTests>
              <param>be.yildizgames.*</param>
            </targetTests>
          </configuration>
        </plugin>

        <plugin>
          <groupId>com.spotify</groupId>
          <artifactId>dockerfile-maven-plugin</artifactId>
          <version>${maven.plugin.docker-image.version}</version>
          <executions>
            <execution>
              <id>build-docker-image</id>
              <phase>package</phase>
              <goals>
                <goal>build</goal>
              </goals>
            </execution>
            <execution>
              <id>push-docker-image</id>
              <phase>install</phase>
              <goals>
                <goal>push</goal>
              </goals>
            </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.3.9</version>
                  </requireMavenVersion>
                  <requireReleaseDeps>
                    <onlyWhenRelease>true</onlyWhenRelease>
                    <message>Snapshot dependencies are not allowed in releases.</message>
                  </requireReleaseDeps>
                </rules>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.owasp</groupId>
          <artifactId>dependency-check-maven</artifactId>
          <version>${maven.plugin.owasp-dependency-check.version}</version>
          <executions>
            <execution>
              <goals>
                <goal>check</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter-api</artifactId>
        <version>${dependency.junit.version}</version>
      </dependency>
      <dependency>
        <groupId>org.junit.platform</groupId>
        <artifactId>junit-platform-launcher</artifactId>
        <version>${dependency.junit-platform.version}</version>
      </dependency>
      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-core</artifactId>
        <version>${dependency.mockito.version}</version>
      </dependency>
      <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-java</artifactId>
        <version>${dependency.cucumber.version}</version>
      </dependency>
      <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-picocontainer</artifactId>
        <version>${dependency.cucumber.version}</version>
      </dependency>
      <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-junit</artifactId>
        <version>${dependency.cucumber.version}</version>
      </dependency>
      <dependency>
        <groupId>com.jayway.awaitility</groupId>
        <artifactId>awaitility</artifactId>
        <version>1.7.0</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <distributionManagement>
    <snapshotRepository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
    <repository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
  </distributionManagement>

  <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.plugins</groupId>
            <artifactId>nexus-staging-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>
    <profile>
      <id>owasp</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.owasp</groupId>
            <artifactId>dependency-check-maven</artifactId>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>

