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

<!--
SPDX-FileCopyrightText: © 2021 Matthias Andreas Benkard <code@mail.matthias.benkard.de>

SPDX-License-Identifier: LGPL-3.0-or-later
-->

<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

  <modelVersion>4.0.0</modelVersion>

  <groupId>eu.mulk.quarkus-googlecloud-jsonlogging</groupId>
  <version>6.1.1-SNAPSHOT</version>

  <artifactId>quarkus-googlecloud-jsonlogging-parent</artifactId>
  <packaging>pom</packaging>

  <name>Quarkus Google Cloud JSON Logging Extension - Parent</name>
  <url>https://gitlab.benkard.de/mulk/quarkus-googlecloud-jsonlogging</url>

  <description>
    A Quarkus extension that logs to standard output in a JSON format
    compatible with Google Cloud Logging.
  </description>

  <licenses>
    <license>
      <name>GNU Lesser General Public License v3.0 or later</name>
      <url>https://www.gnu.org/licenses/lgpl-3.0.html</url>
    </license>
  </licenses>

  <developers>
    <developer>
      <name>Matthias Benkard</name>
      <email>code@mulk.eu</email>
      <organization>Matthias Benkard</organization>
      <organizationUrl>https://matthias.benkard.de</organizationUrl>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:https://gitlab.benkard.de/mulk/quarkus-googlecloud-jsonlogging.git</connection>
    <developerConnection>scm:git:ssh://gerrit.benkard.de:29418/quarkus-googlecloud-jsonlogging</developerConnection>
    <url>https://gitlab.benkard.de/mulk/quarkus-googlecloud-jsonlogging</url>
  </scm>

  <modules>
    <module>core</module>
    <module>deployment</module>
    <module>runtime</module>
  </modules>

  <properties>
    <maven.compiler.parameters>true</maven.compiler.parameters>
    <maven.compiler.release>11</maven.compiler.release>

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

    <compiler-plugin.version>3.12.1</compiler-plugin.version>
    <failsafe-plugin.version>${surefire-plugin.version}</failsafe-plugin.version>
    <flatten-plugin.version>1.6.0</flatten-plugin.version>
    <google-java-format.version>1.15.0</google-java-format.version>
    <jar-plugin.version>3.3.0</jar-plugin.version>
    <maven-gpg-plugin.version>3.1.0</maven-gpg-plugin.version>
    <maven-javadoc-plugin.version>3.6.3</maven-javadoc-plugin.version>
    <maven-source-plugin.version>3.3.0</maven-source-plugin.version>
    <nexus-staging-plugin.version>1.6.13</nexus-staging-plugin.version>
    <spotless-plugin.version>2.43.0</spotless-plugin.version>
    <surefire-plugin.version>3.2.5</surefire-plugin.version>

    <quarkus.version>3.7.1</quarkus.version>
  </properties>

  <distributionManagement>
    <snapshotRepository>
      <id>ossrh</id>
      <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
  </distributionManagement>

  <build>

    <pluginManagement>

      <plugins>

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

        <plugin>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>${surefire-plugin.version}</version>
          <configuration>
            <systemPropertyVariables>
              <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
              <maven.home>${maven.home}</maven.home>
              <maven.repo>${settings.localRepository}</maven.repo>
            </systemPropertyVariables>
          </configuration>
        </plugin>

        <plugin>
          <artifactId>maven-failsafe-plugin</artifactId>
          <version>${failsafe-plugin.version}</version>
          <configuration>
            <systemPropertyVariables>
              <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
              <maven.home>${maven.home}</maven.home>
              <maven.repo>${settings.localRepository}</maven.repo>
            </systemPropertyVariables>
          </configuration>
        </plugin>

        <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>${compiler-plugin.version}</version>
        </plugin>

        <plugin>
          <artifactId>maven-jar-plugin</artifactId>
          <version>${jar-plugin.version}</version>
        </plugin>

        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>flatten-maven-plugin</artifactId>
          <version>${flatten-plugin.version}</version>
          <executions>
            <execution>
              <id>flatten</id>
              <phase>process-resources</phase>
              <goals>
                <goal>flatten</goal>
              </goals>
            </execution>
            <execution>
              <id>flatten.clean</id>
              <phase>clean</phase>
              <goals>
                <goal>clean</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
      </plugins>

    </pluginManagement>

    <plugins>

      <plugin>
        <groupId>com.diffplug.spotless</groupId>
        <artifactId>spotless-maven-plugin</artifactId>
        <version>${spotless-plugin.version}</version>
        <configuration>
          <java>
            <removeUnusedImports/>
            <importOrder>
              <order>java,javax,org,com,de,io,dagger,eu.mulk,</order>
            </importOrder>
            <googleJavaFormat>
              <version>${google-java-format.version}</version>
              <style>GOOGLE</style>
            </googleJavaFormat>
          </java>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.sonatype.plugins</groupId>
        <artifactId>nexus-staging-maven-plugin</artifactId>
        <version>${nexus-staging-plugin.version}</version>
        <extensions>true</extensions>
        <configuration>
          <serverId>ossrh</serverId>
          <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
          <autoReleaseAfterClose>true</autoReleaseAfterClose>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>flatten-maven-plugin</artifactId>
        <configuration>
          <flattenMode>oss</flattenMode>
          <flattenDependencyMode>all</flattenDependencyMode>
          <pomElements>
            <distributionManagement>flatten</distributionManagement>
          </pomElements>
        </configuration>
      </plugin>

    </plugins>
  </build>

  <profiles>

    <profile>
      <id>release</id>

      <build>
        <plugins>

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

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>${maven-javadoc-plugin.version}</version>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
                <configuration>
                  <legacyMode>true</legacyMode>
                </configuration>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>${maven-gpg-plugin.version}</version>
            <configuration>
              <keyname>44DD0CEE515E547A0ABAB1D24F2E30DF0A270EFB</keyname>
            </configuration>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

        </plugins>
      </build>
    </profile>

  </profiles>

</project>