<?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" child.project.url.inherit.append.path="false">
  <modelVersion>4.0.0</modelVersion>
  <groupId>io.quarkiverse</groupId>
  <artifactId>quarkiverse-parent</artifactId>
  <version>18</version>

  <name>Quarkiverse: Parent POM</name>
  <description>Parent POM for Quarkiverse projects that includes the default release and artifact publishing related
    configuration
  </description>
  <url>https://quarkiverse.io</url>

  <inceptionYear>2020</inceptionYear>

  <packaging>pom</packaging>

  <properties>
    <!-- Plugin versions (please keep in alphabetical order) -->
    <version.buildhelper.plugin>3.6.0</version.buildhelper.plugin>
    <version.buildnumber.plugin>3.2.1</version.buildnumber.plugin>
    <version.clean.plugin>3.4.0</version.clean.plugin>
    <version.compiler.plugin>3.13.0</version.compiler.plugin>
    <version.deploy.plugin>3.1.3</version.deploy.plugin>
    <version.enforcer.plugin>3.5.0</version.enforcer.plugin>
    <version.failsafe.plugin>3.5.0</version.failsafe.plugin>
    <version.formatter.plugin>2.24.1</version.formatter.plugin>
    <version.gpg.plugin>3.2.7</version.gpg.plugin>
    <version.impsort.plugin>1.12.0</version.impsort.plugin>
    <version.javadoc.plugin>3.10.0</version.javadoc.plugin>
    <version.jar.plugin>3.4.2</version.jar.plugin>
    <version.nexus-staging.plugin>1.7.0</version.nexus-staging.plugin>
    <version.release.plugin>3.1.1</version.release.plugin>
    <version.resources.plugin>3.3.1</version.resources.plugin>
    <version.source.plugin>3.3.1</version.source.plugin>
    <version.surefire.plugin>3.5.0</version.surefire.plugin>

    <!-- Code format -->
    <version.quarkus.ide-config>3.0.0.Final</version.quarkus.ide-config>
    <format.skip>false</format.skip>

    <!-- Default properties -->
    <maven.compiler.parameters>true</maven.compiler.parameters>
    <maven.compiler.release>17</maven.compiler.release>
    <maven.compiler.source>${maven.compiler.release}</maven.compiler.source>
    <maven.compiler.target>${maven.compiler.release}</maven.compiler.target>
    <maven.compiler.testTarget>${maven.compiler.target}</maven.compiler.testTarget>
    <maven.compiler.testSource>${maven.compiler.source}</maven.compiler.testSource>
    <maven.javadoc.failOnError>false</maven.javadoc.failOnError>

    <!-- Cross plugins settings -->
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

    <!--
        Options to override the compiler arguments directly on the compiler argument line to separate between what
        the IDE understands as the source level and what the Maven compiler actually use.
    -->
    <maven.compiler.argument.target>${maven.compiler.target}</maven.compiler.argument.target>
    <maven.compiler.argument.source>${maven.compiler.source}</maven.compiler.argument.source>
    <maven.compiler.argument.testTarget>${maven.compiler.testTarget}</maven.compiler.argument.testTarget>
    <maven.compiler.argument.testSource>${maven.compiler.testSource}</maven.compiler.argument.testSource>

    <!-- maven-enforcer-plugin -->
    <maven.min.version>3.8.6</maven.min.version>
    <jdk.min.version>${maven.compiler.argument.source}</jdk.min.version>
    <insecure.repositories>ERROR</insecure.repositories>

    <!-- maven-release-plugin -->
    <useReleaseProfile>false</useReleaseProfile>

    <!-- Documentation -->
    <asciidoctorj.version>3.0.0</asciidoctorj.version>
    <asciidoctor-maven-plugin.version>3.0.0</asciidoctor-maven-plugin.version>
    <yaml-properties-maven-plugin.version>1.1.3</yaml-properties-maven-plugin.version>
  </properties>

  <licenses>
    <license>
      <name>Apache License, Version 2.0</name>
      <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <issueManagement>
    <system>GitHub</system>
    <url>https://github.com/quarkusio/quarkus/issues</url>
  </issueManagement>

  <developers>
    <developer>
      <id>quarkus</id>
      <name>Quarkus Community</name>
    </developer>
  </developers>

  <scm child.scm.connection.inherit.append.path="false" child.scm.developerConnection.inherit.append.path="false" child.scm.url.inherit.append.path="false">
    <connection>scm:git:git@github.com:quarkiverse/quarkiverse-parent.git</connection>
    <developerConnection>scm:git:git@github.com:quarkiverse/quarkiverse-parent.git</developerConnection>
    <url>https://github.com/quarkiverse/quarkiverse-parent</url>
    <tag>18</tag>
  </scm>

  <distributionManagement>
    <snapshotRepository>
      <id>ossrh</id>
      <name>Sonatype Central Snapshot Repository</name>
      <url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
    </snapshotRepository>
    <repository>
      <id>oss.sonatype</id>
      <name>Sonatype Central Staging Repository</name>
      <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
  </distributionManagement>

  <build>
    <plugins>

      <!-- Check for the minimum version of Java and Maven.  Runs during the validate phase. -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <executions>
          <execution>
            <id>enforce-java-version</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <bannedRepositories>
                  <message>To build this project, don't use maven repositories over HTTP. Please use HTTPS in your settings.xml or run the build with property insecure.repositories=WARN</message>
                  <level>${insecure.repositories}</level>
                  <bannedRepositories>
                    <bannedRepository>http://*</bannedRepository>
                  </bannedRepositories>
                  <bannedPluginRepositories>
                    <bannedPluginRepository>http://*</bannedPluginRepository>
                  </bannedPluginRepositories>
                </bannedRepositories>
                <requireJavaVersion>
                  <message>To build this project JDK ${jdk.min.version} (or greater) is required. Please install it.</message>
                  <version>${jdk.min.version}</version>
                </requireJavaVersion>
              </rules>
            </configuration>
          </execution>
          <execution>
            <id>enforce-maven-version</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireMavenVersion>
                  <message>To build this project Maven ${maven.min.version} (or greater) is required. Please install it.</message>
                  <version>${maven.min.version}</version>
                </requireMavenVersion>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <!-- Set properties containing the scm revision -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>buildnumber-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>get-scm-revision</id>
            <phase>initialize</phase>
            <goals>
              <goal>create</goal>
            </goals>
            <configuration>
              <doCheck>false</doCheck>
              <doUpdate>false</doUpdate>
              <revisionOnScmFailure>UNKNOWN</revisionOnScmFailure>
              <getRevisionOnlyOnce>true</getRevisionOnlyOnce>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <showDeprecation>true</showDeprecation>
          <showWarnings>true</showWarnings>
          <source>${maven.compiler.argument.source}</source>
          <target>${maven.compiler.argument.target}</target>
          <testSource>${maven.compiler.argument.testSource}</testSource>
          <testTarget>${maven.compiler.argument.testTarget}</testTarget>
          <parameters>true</parameters>
          <compilerArgs>
            <arg>-Xlint:unchecked</arg>
          </compilerArgs>
        </configuration>
      </plugin>

      <!-- Attach source jar to all builds.  Runs during the package phase.-->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

    </plugins>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-gpg-plugin</artifactId>
          <version>${version.gpg.plugin}</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>build-helper-maven-plugin</artifactId>
          <version>${version.buildhelper.plugin}</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>buildnumber-maven-plugin</artifactId>
          <version>${version.buildnumber.plugin}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-clean-plugin</artifactId>
          <version>${version.clean.plugin}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>${version.compiler.plugin}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-enforcer-plugin</artifactId>
          <version>${version.enforcer.plugin}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>${version.jar.plugin}</version>
          <configuration>
            <archive>
              <index>true</index>
              <manifest>
                <addDefaultSpecificationEntries>
                  true
                </addDefaultSpecificationEntries>
                <addDefaultImplementationEntries>
                  true
                </addDefaultImplementationEntries>
              </manifest>
              <manifestEntries>
                <Implementation-URL>${project.url}</Implementation-URL>
                <Java-Version>${java.version}</Java-Version>
                <Java-Vendor>${java.vendor}</Java-Vendor>
                <Os-Name>${os.name}</Os-Name>
                <Os-Arch>${os.arch}</Os-Arch>
                <Os-Version>${os.version}</Os-Version>
                <Scm-Url>${project.scm.url}</Scm-Url>
                <Scm-Connection>${project.scm.connection}</Scm-Connection>
                <Scm-Revision>${buildNumber}</Scm-Revision>
              </manifestEntries>
            </archive>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>${version.javadoc.plugin}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>${version.deploy.plugin}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-release-plugin</artifactId>
          <version>${version.release.plugin}</version>
          <configuration>
            <preparationGoals>clean install</preparationGoals>
            <autoVersionSubmodules>true</autoVersionSubmodules>
            <tagNameFormat>@{project.version}</tagNameFormat>
            <pushChanges>false</pushChanges>
            <localCheckout>true</localCheckout>
            <remoteTagging>false</remoteTagging>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-resources-plugin</artifactId>
          <version>${version.resources.plugin}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>${version.source.plugin}</version>
          <configuration>
            <archive>
              <index>true</index>
              <manifest>
                <addDefaultSpecificationEntries>
                  true
                </addDefaultSpecificationEntries>
                <addDefaultImplementationEntries>
                  true
                </addDefaultImplementationEntries>
              </manifest>
              <manifestEntries>
                <Implementation-URL>${project.url}</Implementation-URL>
                <Java-Version>${java.version}</Java-Version>
                <Java-Vendor>${java.vendor}</Java-Vendor>
                <Os-Name>${os.name}</Os-Name>
                <Os-Arch>${os.arch}</Os-Arch>
                <Os-Version>${os.version}</Os-Version>
                <Scm-Url>${project.scm.url}</Scm-Url>
                <Scm-Connection>${project.scm.connection}</Scm-Connection>
                <Scm-Revision>${buildNumber}</Scm-Revision>
              </manifestEntries>
            </archive>
          </configuration>
        </plugin>
        <plugin>
          <groupId>net.revelc.code.formatter</groupId>
          <artifactId>formatter-maven-plugin</artifactId>
          <version>${version.formatter.plugin}</version>
          <dependencies>
            <dependency>
              <groupId>io.quarkus</groupId>
              <artifactId>quarkus-ide-config</artifactId>
              <version>${version.quarkus.ide-config}</version>
            </dependency>
          </dependencies>
          <configuration>
            <configFile>eclipse-format.xml</configFile>
            <lineEnding>LF</lineEnding>
            <skip>${format.skip}</skip>
          </configuration>
        </plugin>
        <plugin>
          <groupId>net.revelc.code</groupId>
          <artifactId>impsort-maven-plugin</artifactId>
          <version>${version.impsort.plugin}</version>
          <configuration>
            <groups>java.,javax.,jakarta.,org.,com.</groups>
            <staticGroups>*</staticGroups>
            <skip>${format.skip}</skip>
            <removeUnused>true</removeUnused>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>${version.surefire.plugin}</version>
          <configuration>
            <systemPropertyVariables>
              <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
              <maven.home>${maven.home}</maven.home>
              <maven.repo.local>${settings.localRepository}</maven.repo.local>
              <maven.settings>${session.request.userSettingsFile.path}</maven.settings>
              <java.io.tmpdir>${project.build.directory}</java.io.tmpdir>
            </systemPropertyVariables>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-failsafe-plugin</artifactId>
          <version>${version.failsafe.plugin}</version>
          <configuration>
            <systemPropertyVariables>
              <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
              <maven.home>${maven.home}</maven.home>
              <maven.repo.local>${settings.localRepository}</maven.repo.local>
              <maven.settings>${session.request.userSettingsFile.path}</maven.settings>
            </systemPropertyVariables>
          </configuration>
        </plugin>
        <plugin>
          <groupId>it.ozimov</groupId>
          <artifactId>yaml-properties-maven-plugin</artifactId>
          <version>${yaml-properties-maven-plugin.version}</version>
        </plugin>
        <!-- Standalone doc artifact, and dry-run for Antora build of https://github.com/quarkiverse/quarkiverse-docs -->
        <plugin>
          <groupId>org.asciidoctor</groupId>
          <artifactId>asciidoctor-maven-plugin</artifactId>
          <version>${asciidoctor-maven-plugin.version}</version>
          <configuration>
            <enableVerbose>true</enableVerbose>
            <logHandler>
              <failIf>
                <severity>WARN</severity>
              </failIf>
            </logHandler>
            <sourceDirectory>${project.basedir}/modules/ROOT/pages/</sourceDirectory>
            <preserveDirectories>true</preserveDirectories>
            <attributes>
              <icons>font</icons>
              <!-- Antora images path -->
              <imagesdir>./_images/</imagesdir>
              <sectanchors>true</sectanchors>
              <!-- set the idprefix to blank -->
              <idprefix />
              <idseparator>-</idseparator>
              <docinfo1>true</docinfo1>
              <!-- avoid content security policy violations -->
              <skip-front-matter>true</skip-front-matter>
            </attributes>
          </configuration>
          <executions>
            <execution>
              <id>output-html</id>
              <phase>prepare-package</phase>
              <goals>
                <goal>process-asciidoc</goal>
              </goals>
              <configuration>
                <backend>html5</backend>
                <attributes>
                  <source-highlighter>coderay</source-highlighter>
                  <!-- avoid content security policy violations -->
                  <linkcss>true</linkcss>
                  <copycss>true</copycss>
                </attributes>
              </configuration>
            </execution>
          </executions>
          <dependencies>
            <dependency>
              <groupId>org.asciidoctor</groupId>
              <artifactId>asciidoctorj</artifactId>
              <version>${asciidoctorj.version}</version>
            </dependency>
          </dependencies>
        </plugin>
        <plugin>
          <groupId>org.sonatype.plugins</groupId>
          <artifactId>nexus-staging-maven-plugin</artifactId>
          <version>${version.nexus-staging.plugin}</version>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>
  <profiles>
    <profile>
      <id>format</id>
      <activation>
        <!-- This profile is effectively activated by default -->
        <property>
          <name>!no-format</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>net.revelc.code.formatter</groupId>
            <artifactId>formatter-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>format-sources</id>
                <phase>process-sources</phase>
                <goals>
                  <goal>format</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>net.revelc.code</groupId>
            <artifactId>impsort-maven-plugin</artifactId>
            <configuration>
              <removeUnused>true</removeUnused>
            </configuration>
            <executions>
              <execution>
                <id>sort-imports</id>
                <phase>process-sources</phase>
                <goals>
                  <goal>sort</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>validate</id>
      <activation>
        <property>
          <name>no-format</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>net.revelc.code.formatter</groupId>
            <artifactId>formatter-maven-plugin</artifactId>
            <executions>
              <execution>
                <phase>process-sources</phase>
                <goals>
                  <goal>validate</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>net.revelc.code</groupId>
            <artifactId>impsort-maven-plugin</artifactId>
            <configuration>
              <removeUnused>true</removeUnused>
            </configuration>
            <executions>
              <execution>
                <id>check-imports</id>
                <goals>
                  <goal>check</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <configuration>
              <gpgArguments>
                <arg>--pinentry-mode</arg>
                <arg>loopback</arg>
              </gpgArguments>
            </configuration>
            <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>
            <executions>
              <execution>
                <phase>package</phase>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <extensions>true</extensions>
            <configuration>
              <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
              <serverId>ossrh</serverId>
              <autoReleaseAfterClose>true</autoReleaseAfterClose>
              <stagingProgressTimeoutMinutes>60</stagingProgressTimeoutMinutes>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
