<?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>

  <groupId>io.github.microcks</groupId>
  <artifactId>microcks-java-client</artifactId>
  <version>0.0.5</version>

  <name>Microcks Java Client</name>
  <description>Java Client for interacting with Microcks API</description>
  <url>https://microcks.io</url>
  <organization>
    <name>Microcks</name>
    <url>https://microcks.io</url>
  </organization>

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

  <developers>
    <developer>
      <id>microcks</id>
      <name>Microcks Development Team</name>
      <organizationUrl>https://microcks.github.io/</organizationUrl>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:https://github.com/microcks/microcks-java-client.git</connection>
    <developerConnection>scm:git:https://github.com/microcks/microcks-java-client.git</developerConnection>
    <url>http://github.com/microcks/microcks-java-client/</url>
    <tag>HEAD</tag>
  </scm>

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

  <properties>
    <maven.compiler.source>17</maven.compiler.source>
    <maven.compiler.target>17</maven.compiler.target>
    <maven-surefire-plugin.version>3.5.2</maven-surefire-plugin.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <jackson.version>2.18.2</jackson.version>
    <jakarta-annotation.version>3.0.0</jakarta-annotation.version>
    <jackson-databind-nullable.version>0.2.6</jackson-databind-nullable.version>
    <apache-httpcore.version>4.4.16</apache-httpcore.version>
    <apache-httpmime.version>4.5.14</apache-httpmime.version>
    <microcks-testcontainers.version>0.3.0</microcks-testcontainers.version>
    <keycloak-testcontainers.version>3.6.0</keycloak-testcontainers.version>
    <junit.version>5.12.2</junit.version>
    <testcontainers.version>1.21.0</testcontainers.version>
  </properties>

  <dependencies>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
      <version>${jackson.version}</version>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.datatype</groupId>
      <artifactId>jackson-datatype-jsr310</artifactId>
      <version>${jackson.version}</version>
    </dependency>
    <dependency>
      <groupId>org.openapitools</groupId>
      <artifactId>jackson-databind-nullable</artifactId>
      <version>${jackson-databind-nullable.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpcore</artifactId>
      <version>${apache-httpcore.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpmime</artifactId>
      <version>${apache-httpmime.version}</version>
    </dependency>

    <dependency>
      <groupId>jakarta.annotation</groupId>
      <artifactId>jakarta.annotation-api</artifactId>
      <version>${jakarta-annotation.version}</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>io.github.microcks</groupId>
      <artifactId>microcks-testcontainers</artifactId>
      <version>${microcks-testcontainers.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.github.dasniko</groupId>
      <artifactId>testcontainers-keycloak</artifactId>
      <version>${keycloak-testcontainers.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.testcontainers</groupId>
      <artifactId>junit-jupiter</artifactId>
      <version>${testcontainers.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
      <version>1.5.16</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${maven-surefire-plugin.version}</version>
        <configuration>
          <includes>
            <include>**/*Test.java</include>
          </includes>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.openapitools</groupId>
        <artifactId>openapi-generator-maven-plugin</artifactId>
        <version>7.11.0</version>
        <executions>
          <execution>
            <goals>
              <goal>generate</goal>
            </goals>
            <configuration>
              <inputSpec>${project.basedir}/api/microcks-openapi-v1.11.yaml</inputSpec>
              <generatorName>java</generatorName>
              <library>native</library>

              <generateSupportingFiles>true</generateSupportingFiles>
              <generateApiTests>false</generateApiTests>
              <generateApiDocumentation>false</generateApiDocumentation>
              <generateModelTests>false</generateModelTests>
              <generateModelDocumentation>false</generateModelDocumentation>

              <configOptions>
                <useJakartaEe>true</useJakartaEe>
                <sourceFolder>/</sourceFolder>
                <apiPackage>io.github.microcks.client.api</apiPackage>
                <modelPackage>io.github.microcks.client.model</modelPackage>
              </configOptions>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>3.11.2</version>
            <executions>
              <execution>
                <id>attach-javadoc</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>3.3.1</version>
            <executions>
              <execution>
                <id>attach-source</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.spdx</groupId>
            <artifactId>spdx-maven-plugin</artifactId>
            <version>0.7.4</version>
            <executions>
              <execution>
                <id>build-spdx</id>
                <phase>package</phase>
                <goals>
                  <goal>createSPDX</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <spdxFile>${project.reporting.outputDirectory}/${project.artifactId}-${project.version}.spdx-sbom.json</spdxFile>
              <spdxDocumentNamespace>http://spdx.org/spdxpackages/${project.artifactId}-${project.version}</spdxDocumentNamespace>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.jreleaser</groupId>
            <artifactId>jreleaser-maven-plugin</artifactId>
            <version>1.16.0</version>
            <inherited>false</inherited>
            <configuration>
              <configFile>jreleaser.yml</configFile>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>