<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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.ibm.cloud</groupId>
    <artifactId>sdk-core</artifactId>
    <packaging>jar</packaging>
    <name>sdk-core</name>
    <version>9.22.2</version>
    <description>Core functionality required by code generated by the IBM
        OpenAPI SDK Generator</description>
    <url>https://github.com/IBM/java-sdk-core</url>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <!--
            To check if newer versions of dependencies are available, run:
               mvn versions:display-dependency-updates
        -->
        <testng-version>7.10.2</testng-version>
        <testng-slf4j-version>2.0.16</testng-slf4j-version>
        <surefire-version>3.1.2</surefire-version>
        <checkstyle-plugin-version>3.3.0</checkstyle-plugin-version>
        <checkstyle-version>10.17.0</checkstyle-version>
        <jacoco-plugin-version>0.8.10</jacoco-plugin-version>
        <compiler-plugin-version>3.11.0</compiler-plugin-version>
        <okhttp3-version>4.12.0</okhttp3-version>
        <gson-version>2.11.0</gson-version>
        <commons-codec-version>1.17.1</commons-codec-version>
        <commons-io-version>2.16.1</commons-io-version>
        <commons-lang3-version>3.16.0</commons-lang3-version>
        <rx-version>2.2.21</rx-version>
        <mockito-version>5.12.0</mockito-version>
        <maven-deploy-plugin-version>3.1.1</maven-deploy-plugin-version>
        <nexus-staging-plugin-version>1.6.13</nexus-staging-plugin-version>
        <maven-gpg-plugin-version>3.1.0</maven-gpg-plugin-version>

        <maven-enforcer-version>3.4.1</maven-enforcer-version>
        <min-jdk-version>11</min-jdk-version>
        <min-maven-version>3.5.0</min-maven-version>

        <java-source-version>1.8</java-source-version>
        <java-target-version>1.8</java-target-version>

        <!-- versions of transitive dependencies we need to override to avoid
         vulnerability alerts -->
        <junit-version>4.13.2</junit-version>
        <kotlin-version>1.9.25</kotlin-version>

        <!-- This property should be empty by default. -->
        <surefireJvmArgs></surefireJvmArgs>
    </properties>

    <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 Cloud Developer Experience</name>
    </organization>

    <scm>
        <connection>scm:git:https://github.com/IBM/java-sdk-core</connection>
        <developerConnection>scm:git:https://github.com/IBM/java-sdk-core</developerConnection>
        <url>https://github.com/IBM/java-sdk-core/tree/main</url>
    </scm>

    <issueManagement>
        <system>Github</system>
        <url>https://github.com/IBM/java-sdk-core/issues</url>
    </issueManagement>

    <ciManagement>
        <system>Travis-CI</system>
        <url>https://travis-ci.org/IBM/java-sdk-core/</url>
    </ciManagement>

    <!-- We define this in the profile below -->
    <distributionManagement></distributionManagement>

    <!-- we currently don't need any non-public repositories -->
    <repositories></repositories>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit-version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.squareup.okhttp3</groupId>
            <artifactId>okhttp</artifactId>
            <version>${okhttp3-version}</version>
        </dependency>
        <dependency>
            <groupId>com.squareup.okhttp3</groupId>
            <artifactId>logging-interceptor</artifactId>
            <version>${okhttp3-version}</version>
        </dependency>
        <dependency>
            <groupId>com.squareup.okhttp3</groupId>
            <artifactId>okhttp-urlconnection</artifactId>
            <version>${okhttp3-version}</version>
        </dependency>
        <dependency>
            <groupId>com.squareup.okhttp3</groupId>
            <artifactId>mockwebserver</artifactId>
            <version>${okhttp3-version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>commons-codec</groupId>
            <artifactId>commons-codec</artifactId>
            <version>${commons-codec-version}</version>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>${commons-io-version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>${commons-lang3-version}</version>
        </dependency>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>${testng-version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${testng-slf4j-version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <version>${testng-slf4j-version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>${gson-version}</version>
        </dependency>
        <dependency>
            <groupId>io.reactivex.rxjava2</groupId>
            <artifactId>rxjava</artifactId>
            <version>${rx-version}</version>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>${mockito-version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-inline</artifactId>
            <version>5.2.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-stdlib-jdk8</artifactId>
            <version>${kotlin-version}</version>
        </dependency>
        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-stdlib</artifactId>
            <version>${kotlin-version}</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>${maven-enforcer-version}</version>
                <executions>
                    <execution>
                        <id>enforce-versions</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireMavenVersion>
                                    <version>${min-maven-version}</version>
                                    <message>Apache Maven ${min-maven-version}+
                                        is required to build this project.</message>
                                </requireMavenVersion>
                                <requireJavaVersion>
                                    <version>${min-jdk-version}</version>
                                    <message>Java ${min-jdk-version}+ is
                                        required to build this project.</message>
                                </requireJavaVersion>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <!-- Disable default maven-deploy-plugin -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>${maven-deploy-plugin-version}</version>
                <configuration>
                    <skip>true</skip>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.0.1</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>3.0.1</version>
                <configuration>
                    <show>public</show>
                    <doctitle>${project.name}, version ${project.version}</doctitle>
                    <footer>IBM Corporation</footer>
                    <source>8</source>
                    <detectJavaApiLink>false</detectJavaApiLink>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>${checkstyle-plugin-version}</version>
                <executions>
                    <execution>
                        <id>verify-style</id>
                        <phase>test</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <failsOnError>true</failsOnError>
                    <configLocation>build/checkstyle.xml</configLocation>
                    <consoleOutput>true</consoleOutput>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>com.puppycrawl.tools</groupId>
                        <artifactId>checkstyle</artifactId>
                        <version>${checkstyle-version}</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${jacoco-plugin-version}</version>
                <executions>
                    <execution>
                        <id>prepare-agent</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>report</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>post-unit-test</id>
                        <phase>test</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                        <configuration>
                            <append>true</append>
                            <destFile>${sonar.jacoco.reportPath}</destFile>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${compiler-plugin-version}</version>
                <configuration>
                    <source>${java-source-version}</source>
                    <target>${java-target-version}</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${surefire-version}</version>
                <configuration>
                    <reuseForks>false</reuseForks>
                    <forkCount>1</forkCount>
                    <argLine>@{argLine} ${surefireJvmArgs}</argLine>
                </configuration>
            </plugin>
        </plugins>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
    </build>

    <developers>
        <developer>
            <name>IBM Cloud DevX SDK Development</name>
            <email>devxsdk@us.ibm.com</email>
            <url>https://www.ibm.com/</url>
            <organization>IBM Cloud Developer Experience</organization>
            <organizationUrl>http://www.ibm.com</organizationUrl>
        </developer>
    </developers>

    <profiles>

        <!-- "central" is used to deploy artifacts on maven central -->
        <profile>
            <id>central</id>

            <distributionManagement>
                <snapshotRepository>
                    <!-- We don't deploy snapshot releases -->
                </snapshotRepository>
                <repository>
                    <!-- This is where the nexus staging plugin will publish
               artifacts -->
                    <id>ossrh</id>
                    <url>
                        https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
                </repository>
            </distributionManagement>

            <build>
                <plugins>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>${nexus-staging-plugin-version}</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                            <keepStagingRepositoryOnCloseRuleFailure>true</keepStagingRepositoryOnCloseRuleFailure>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${maven-gpg-plugin-version}</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <gpgArguments>
                                <arg>--batch</arg>
                                <arg>--pinentry-mode</arg>
                                <arg>loopback</arg>
                            </gpgArguments>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
            <properties>
                <!-- Configure the gpg plugin to use the env vars defined in the
             Travis build settings -->
                <gpg.keyname>${env.GPG_KEYNAME}</gpg.keyname>
                <gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase>
            </properties>
        </profile>
    </profiles>

</project>
