<?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>
  <parent>
    <groupId>org.jboss</groupId>
    <artifactId>jboss-parent</artifactId>
    <version>39</version>
  </parent>
  <groupId>io.quarkiverse</groupId>
  <artifactId>quarkiverse-parent</artifactId>
  <version>12</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>
    <version.formatter.plugin>2.21.0</version.formatter.plugin>
    <version.impsort.plugin>1.8.0</version.impsort.plugin>
    <!-- Code format -->
    <version.quarkus.ide-config>2.5.1.Final</version.quarkus.ide-config>
    <format.skip>false</format.skip>
    <!-- Default properties -->
    <maven.compiler.parameters>true</maven.compiler.parameters>
    <maven.compiler.source>11</maven.compiler.source>
    <maven.compiler.target>11</maven.compiler.target>
    <maven.compiler.release>11</maven.compiler.release>
    <maven.javadoc.failOnError>false</maven.javadoc.failOnError>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

    <nexus-staging-maven-plugin.version>1.6.13</nexus-staging-maven-plugin.version>
    <!-- Documentation -->
    <asciidoctorj.version>2.5.7</asciidoctorj.version>
    <asciidoctor-maven-plugin.version>2.2.2</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>aloubyansky</id>
      <name>Alexey Loubyansky</name>
      <email>alexey.loubyansky@redhat.com</email>
      <organization>Red Hat</organization>
      <organizationUrl>https://www.redhat.com/</organizationUrl>
    </developer>
    <developer>
      <id>gastaldi</id>
      <name>George Gastaldi</name>
      <email>ggastald@redhat.com</email>
      <organization>Red Hat</organization>
      <organizationUrl>https://www.redhat.com/</organizationUrl>
    </developer>
    <developer>
      <id>maxandersen</id>
      <name>Max Rydahl Andersen</name>
      <email>max@xam.dk</email>
      <organization>Red Hat</organization>
      <organizationUrl>https://www.redhat.com/</organizationUrl>
    </developer>
  </developers>

  <scm>
    <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>12</tag>
  </scm>

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

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <configuration>
          <preparationGoals>clean install</preparationGoals>
          <autoVersionSubmodules>true</autoVersionSubmodules>
          <tagNameFormat>@{project.version}</tagNameFormat>
          <pushChanges>false</pushChanges>
          <localCheckout>true</localCheckout>
          <remoteTagging>false</remoteTagging>
        </configuration>
      </plugin>
    </plugins>
    <pluginManagement>
      <plugins>
        <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>
          <artifactId>maven-surefire-plugin</artifactId>
          <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>
          <artifactId>maven-failsafe-plugin</artifactId>
          <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>
      </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>
            <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>
            <version>${nexus-staging-maven-plugin.version}</version>
            <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>
