<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>io.github.belgif.rest.problem</groupId>
  <artifactId>belgif-rest-problem-parent</artifactId>
  <version>0.18.0</version>
  <packaging>pom</packaging>
  <name>${project.groupId}:${project.artifactId}</name>
  <description>
    Java library for RFC 9457 Problems with support for standard problem types of the Belgif REST guide
    (https://www.belgif.be/specification/rest/api-guide/#error-handling).
  </description>
  <url>https://github.com/belgif/rest-problem-java</url>

  <properties>
    <revision>latest</revision>
    <maven.compiler.release>8</maven.compiler.release>
    <maven.compiler.parameters>true</maven.compiler.parameters>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <!-- Aligns with version used on JBoss EAP 7.4 -->
    <version.jackson.minimal>2.12.7</version.jackson.minimal>
    <version.spring.boot.2>2.7.18</version.spring.boot.2>
    <version.spring.boot.3>3.5.6</version.spring.boot.3>
    <version.quarkus>3.29.4</version.quarkus>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.junit</groupId>
        <artifactId>junit-bom</artifactId>
        <version>6.0.1</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>org.assertj</groupId>
        <artifactId>assertj-core</artifactId>
        <version>3.27.6</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-junit-jupiter</artifactId>
        <version>5.20.0</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.junit-pioneer</groupId>
        <artifactId>junit-pioneer</artifactId>
        <version>2.3.0</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>io.rest-assured</groupId>
        <artifactId>rest-assured</artifactId>
        <version>5.4.0</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.jacoco</groupId>
        <artifactId>org.jacoco.agent</artifactId>
        <version>0.8.14</version>
        <scope>test</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <modules>
    <module>belgif-rest-problem</module>
    <module>belgif-rest-problem-validator</module>
    <module>belgif-rest-problem-java-ee</module>
    <module>belgif-rest-problem-spring</module>
    <module>belgif-rest-problem-spring-boot-2</module>
    <module>belgif-rest-problem-spring-boot-3</module>
    <module>belgif-rest-problem-quarkus</module>
    <module>belgif-rest-problem-quarkus-deployment</module>
    <module>belgif-rest-problem-it</module>
    <module>belgif-rest-problem-bom</module>
  </modules>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-clean-plugin</artifactId>
          <version>3.5.0</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-dependency-plugin</artifactId>
          <version>3.9.0</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.14.1</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-resources-plugin</artifactId>
          <version>3.3.1</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>3.5.4</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-failsafe-plugin</artifactId>
          <version>3.5.4</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-war-plugin</artifactId>
          <version>3.5.0</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>3.12.0</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-gpg-plugin</artifactId>
          <version>3.2.8</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>3.3.1</version>
        </plugin>
        <plugin>
          <groupId>org.sonatype.central</groupId>
          <artifactId>central-publishing-maven-plugin</artifactId>
          <version>0.9.0</version>
        </plugin>
        <plugin>
          <groupId>org.asciidoctor</groupId>
          <artifactId>asciidoctor-maven-plugin</artifactId>
          <version>3.2.0</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>flatten-maven-plugin</artifactId>
          <version>1.7.3</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>build-helper-maven-plugin</artifactId>
          <version>3.6.1</version>
        </plugin>
        <plugin>
          <groupId>com.diffplug.spotless</groupId>
          <artifactId>spotless-maven-plugin</artifactId>
          <version>3.1.0</version>
        </plugin>
        <plugin>
          <groupId>org.openapitools</groupId>
          <artifactId>openapi-generator-maven-plugin</artifactId>
          <version>7.17.0</version>
        </plugin>
        <plugin>
          <groupId>io.swagger.codegen.v3</groupId>
          <artifactId>swagger-codegen-maven-plugin</artifactId>
          <version>3.0.75</version>
        </plugin>
        <plugin>
          <groupId>org.sonarsource.scanner.maven</groupId>
          <artifactId>sonar-maven-plugin</artifactId>
          <version>5.3.0.6276</version>
        </plugin>
        <plugin>
          <groupId>org.jacoco</groupId>
          <artifactId>jacoco-maven-plugin</artifactId>
          <version>0.8.14</version>
        </plugin>
        <plugin>
          <groupId>org.eclipse.transformer</groupId>
          <artifactId>transformer-maven-plugin</artifactId>
          <version>1.0.0</version>
          <configuration>
            <rules>
              <jakartaDefaults>true</jakartaDefaults>
            </rules>
            <artifact>
              <groupId>${project.groupId}</groupId>
              <artifactId>${project.artifactId}</artifactId>
            </artifact>
            <classifier>jakarta</classifier>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>exec-maven-plugin</artifactId>
          <version>3.6.2</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-antrun-plugin</artifactId>
          <version>3.2.0</version>
        </plugin>
        <plugin>
          <groupId>io.smallrye</groupId>
          <artifactId>jandex-maven-plugin</artifactId>
          <version>3.5.2</version>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.asciidoctor</groupId>
        <artifactId>asciidoctor-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>output-html</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>process-asciidoc</goal>
            </goals>
            <configuration>
              <attributes>
                <source-highlighter>coderay</source-highlighter>
                <version>${project.version}</version>
              </attributes>
              <outputDirectory>target/site</outputDirectory>
            </configuration>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>io.spring.asciidoctor</groupId>
            <artifactId>spring-asciidoctor-extensions-block-switch</artifactId>
            <version>0.6.3</version>
          </dependency>
        </dependencies>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <executions>
          <execution>
            <id>generate-javadoc</id>
            <phase>process-sources</phase>
            <goals>
              <goal>aggregate-no-fork</goal>
            </goals>
            <inherited>false</inherited>
            <configuration>
              <skippedModules>belgif-rest-problem-it,jacoco-aggregator</skippedModules>
              <doclint>all,-missing</doclint>
              <notimestamp>true</notimestamp>
              <doctitle>belgif-rest-problem ${project.version}</doctitle>
              <excludePackageNames>*.internal</excludePackageNames>
              <additionalDependencies>
                <dependency>
                  <groupId>jakarta.platform</groupId>
                  <artifactId>jakarta.jakartaee-api</artifactId>
                  <version>8.0.0</version>
                </dependency>
              </additionalDependencies>
              <outputDirectory>${project.build.directory}/site</outputDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>flatten-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>flatten</id>
            <phase>process-resources</phase>
            <configuration>
              <updatePomFile>true</updatePomFile>
              <flattenMode>resolveCiFriendliesOnly</flattenMode>
              <outputDirectory>${project.build.directory}/flattened-pom</outputDirectory>
              <flattenedPomFilename>${project.artifactId}-${project.version}.pom</flattenedPomFilename>
            </configuration>
            <goals>
              <goal>flatten</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>com.diffplug.spotless</groupId>
        <artifactId>spotless-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>spotless-check</id>
            <phase>process-sources</phase>
            <goals>
              <goal>check</goal>
            </goals>
            <inherited>false</inherited>
          </execution>
        </executions>
        <configuration>
          <encoding>${project.build.sourceEncoding}</encoding>
          <lineEndings>UNIX</lineEndings>
          <java>
            <includes>
              <include>**/*.java</include>
            </includes>
            <excludes>
              <exclude>**/target/**</exclude>
            </excludes>
            <eclipse>
              <version>4.30</version>
              <file>spotless/eclipse-java-formatter.xml</file>
            </eclipse>
            <importOrder>
              <order>java,javax,jakarta,org,com</order>
            </importOrder>
            <removeUnusedImports />
            <endWithNewline />
            <trimTrailingWhitespace />
            <indent>
              <spaces>true</spaces>
              <spacesPerTab>4</spacesPerTab>
            </indent>
          </java>
          <formats>
            <format>
              <includes>
                <include>**/*.xml</include>
              </includes>
              <excludes>
                <exclude>**/target/**</exclude>
                <exclude>**/.idea/**</exclude>
                <exclude>**/standalone-openshift.xml</exclude>
              </excludes>
              <eclipseWtp>
                <type>XML</type>
                <files>
                  <file>spotless/org.eclipse.wst.xml.core.prefs</file>
                </files>
              </eclipseWtp>
              <endWithNewline />
              <trimTrailingWhitespace />
              <indent>
                <spaces>true</spaces>
                <spacesPerTab>2</spacesPerTab>
              </indent>
            </format>
          </formats>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <developers>
    <developer>
      <name>KSZ-BCSS REST tools team</name>
      <email>RestToolsTeam@ksz-bcss.fgov.be</email>
    </developer>
  </developers>

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

  <scm>
    <connection>scm:git:git://github.com/belgif/rest-problem-java.git</connection>
    <developerConnection>scm:git:ssh://github.com:belgif/rest-problem-java.git</developerConnection>
    <url>https://github.com/belgif/rest-problem-java</url>
  </scm>

  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <executions>
              <execution>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
                <configuration>
                  <signer>bc</signer>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <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>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-javadoc</id>
                <goals>
                  <goal>jar</goal>
                </goals>
                <configuration>
                  <doclint>all,-missing</doclint>
                  <excludePackageNames>*.internal</excludePackageNames>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.sonatype.central</groupId>
            <artifactId>central-publishing-maven-plugin</artifactId>
            <extensions>true</extensions>
            <configuration>
              <publishingServerId>central</publishingServerId>
              <deploymentName>belgif-rest-problem</deploymentName>
              <autoPublish>true</autoPublish>
              <waitUntil>published</waitUntil>
              <waitMaxTime>3600</waitMaxTime>
              <excludeArtifacts>
                <excludeArtifact>jacoco-aggregator</excludeArtifact>
                <excludeArtifact>belgif-rest-problem-it</excludeArtifact>
                <excludeArtifact>belgif-rest-problem-apt</excludeArtifact>
                <excludeArtifact>belgif-rest-problem-codegen-it</excludeArtifact>
                <excludeArtifact>belgif-rest-problem-it-common</excludeArtifact>
                <excludeArtifact>belgif-rest-problem-jackson-latest-it</excludeArtifact>
                <excludeArtifact>belgif-rest-problem-jackson-minimal-it</excludeArtifact>
                <excludeArtifact>belgif-rest-problem-jakarta-ee-it</excludeArtifact>
                <excludeArtifact>belgif-rest-problem-java-ee-it</excludeArtifact>
                <excludeArtifact>belgif-rest-problem-quarkus-it</excludeArtifact>
                <excludeArtifact>belgif-rest-problem-spring-boot-2-it</excludeArtifact>
                <excludeArtifact>belgif-rest-problem-spring-boot-3-it</excludeArtifact>
              </excludeArtifacts>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>sonar</id>
      <properties>
        <sonar.organization>belgif</sonar.organization>
        <sonar.host.url>https://sonarcloud.io</sonar.host.url>
        <sonar.projectName>rest-problem-java</sonar.projectName>
        <sonar.projectKey>belgif_rest-problem-java</sonar.projectKey>
        <sonar.coverage.jacoco.xmlReportPaths>${maven.multiModuleProjectDirectory}/jacoco-aggregator/target/jacoco.xml
        </sonar.coverage.jacoco.xmlReportPaths>
        <sonar.coverage.exclusions>**/belgif-rest-problem-it/**</sonar.coverage.exclusions>
        <sonar.cpd.exclusions>**/belgif-rest-problem-it/**,**/src/test/java/**</sonar.cpd.exclusions>
      </properties>
      <modules>
        <module>belgif-rest-problem</module>
        <module>belgif-rest-problem-validator</module>
        <module>belgif-rest-problem-java-ee</module>
        <module>belgif-rest-problem-spring</module>
        <module>belgif-rest-problem-spring-boot-2</module>
        <module>belgif-rest-problem-spring-boot-3</module>
        <module>belgif-rest-problem-quarkus</module>
        <module>belgif-rest-problem-quarkus-deployment</module>
        <module>belgif-rest-problem-it</module>
        <module>belgif-rest-problem-bom</module>
        <module>jacoco-aggregator</module>
      </modules>
      <build>
        <plugins>
          <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>jacoco-prepare-agent</id>
                <goals>
                  <goal>prepare-agent</goal>
                </goals>
                <configuration>
                  <includes>io.github.belgif.rest.problem.*</includes>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.sonarsource.scanner.maven</groupId>
            <artifactId>sonar-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>sonar</id>
                <phase>verify</phase>
                <goals>
                  <goal>sonar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
