<?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>
  <name>IBM watsonx.ai Java SDK</name>
  <groupId>com.ibm.watsonx</groupId>
  <artifactId>watsonx-ai-parent</artifactId>
  <version>0.18.0</version>
  <packaging>pom</packaging>
  <url>https://github.com/IBM/watsonx-ai-java-sdk</url>
  <description>Java client library and SDK for IBM watsonx.ai</description>
  <scm>
    <connection>scm:git:git://github.com/IBM/watsonx-ai-java-sdk.git</connection>
    <developerConnection>scm:git:ssh://github.com/IBM/watsonx-ai-java-sdk.git</developerConnection>
    <url>https://github.com/IBM/watsonx-ai-java-sdk</url>
  </scm>

  <modules>
    <module>modules/watsonx-ai-core</module>
    <module>modules/watsonx-ai</module>
  </modules>

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

  <organization>
    <name>IBM Corporation</name>
  </organization>

  <properties>
    <maven.compiler.release>17</maven.compiler.release>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <maven-source-plugin-version>3.4.0</maven-source-plugin-version>
    <maven-javadoc-plugin-version>3.12.0</maven-javadoc-plugin-version>
    <maven-gpg-plugin-version>3.2.8</maven-gpg-plugin-version>
    <central-publishing-maven-plugin-version>0.10.0</central-publishing-maven-plugin-version>
    <maven-compiler-plugin-version>3.14.1</maven-compiler-plugin-version>
    <build-helper-maven-plugin-version>3.6.1</build-helper-maven-plugin-version>
    <license-maven-plugin-version>5.0.0</license-maven-plugin-version>
    <formatter-maven-plugin-version>2.29.0</formatter-maven-plugin-version>
    <maven-surefire-plugin-version>3.5.4</maven-surefire-plugin-version>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
    </dependency>

    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-api</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-junit-jupiter</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.skyscreamer</groupId>
      <artifactId>jsonassert</artifactId>
      <version>2.0-rc1</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.wiremock</groupId>
      <artifactId>wiremock</artifactId>
      <version>3.13.2</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-api</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-core</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-slf4j2-impl</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>uk.org.webcompere</groupId>
      <artifactId>system-stubs-jupiter</artifactId>
      <version>2.1.8</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>com.fasterxml.jackson</groupId>
        <artifactId>jackson-bom</artifactId>
        <version>2.21.0</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>

      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-bom</artifactId>
        <version>2.0.17</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>

      <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-bom</artifactId>
        <version>2.25.3</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>

      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-bom</artifactId>
        <version>5.21.0</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>

      <dependency>
        <groupId>org.junit</groupId>
        <artifactId>junit-bom</artifactId>
        <version>6.0.2</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>${build-helper-maven-plugin-version}</version>
        <executions>
          <execution>
            <id>timestamp-property</id>
            <phase>initialize</phase>
            <goals>
              <goal>timestamp-property</goal>
            </goals>
            <configuration>
              <name>currentYear</name>
              <pattern>yyyy</pattern>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>com.mycila</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <version>${license-maven-plugin-version}</version>
        <configuration>
          <licenseSets>
            <licenseSet>
              <header>config/license-header</header>
              <includes>
                <include>**/*.java</include>
              </includes>
            </licenseSet>
          </licenseSets>
        </configuration>
        <executions>
          <execution>
            <id>license-format</id>
            <phase>compile</phase>
            <goals>
              <goal>format</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>net.revelc.code.formatter</groupId>
        <artifactId>formatter-maven-plugin</artifactId>
        <version>${formatter-maven-plugin-version}</version>
        <executions>
          <execution>
            <id>formatter-format</id>
            <phase>compile</phase>
            <goals>
              <goal>format</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <configFile>${project.basedir}/../../config/eclipse-formatter.xml</configFile>
          <lineEnding>LF</lineEnding>
          <encoding>UTF-8</encoding>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${maven-surefire-plugin-version}</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>${maven-compiler-plugin-version}</version>
      </plugin>

      <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</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>
              <failOnError>false</failOnError>
              <additionalJOption>-Xdoclint:none</additionalJOption>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>

    <profile>
      <id>integration-tests</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>${maven-surefire-plugin-version}</version>
            <configuration>
              <skip>true</skip>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
            <version>${maven-surefire-plugin-version}</version>
            <configuration>
              <includes>
                <include>**/it/*IT.java</include>
              </includes>
            </configuration>
            <executions>
              <execution>
                <id>integration-tests</id>
                <goals>
                  <goal>integration-test</goal>
                  <goal>verify</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>sign</id>
      <properties>
        <skipTests>true</skipTests>
      </properties>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>${maven-gpg-plugin-version}</version>
            <executions>
              <execution>
                <id>sign</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.sonatype.central</groupId>
            <artifactId>central-publishing-maven-plugin</artifactId>
            <version>${central-publishing-maven-plugin-version}</version>
            <extensions>true</extensions>
            <configuration>
              <publishingServerId>central</publishingServerId>
              <autoPublish>true</autoPublish>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

  </profiles>

  <developers>
    <developer>
      <name>Andrea Di Maio</name>
      <email>andrea.dimaio@it.ibm.com</email>
    </developer>
  </developers>

</project>