<?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>${publish.groupId}</groupId>
  <artifactId>di-java-sdk</artifactId>
  <version>0.0.3</version>
  <packaging>jar</packaging>

  <name>Candescent Digital Insight Java SDK</name>
  <description>Java server SDK for the Candescent Digital Insight API</description>
  <url>https://github.com/dfh-digital-insight/cdx-java-sdk</url>

  <licenses>
    <license>
      <name>Proprietary</name>
      <url>https://docs.candescent.com/guides/Legal/tcs/</url>
      <distribution>repo</distribution>
      <comments>Copyright (c) Candescent. Use is governed by the Candescent Developer Agreement.</comments>
    </license>
  </licenses>

  <developers>
    <developer>
      <name>Candescent</name>
      <email>developer@candescent.com</email>
      <organization>Candescent</organization>
      <organizationUrl>https://www.candescent.com</organizationUrl>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:git://github.com/dfh-digital-insight/cdx-java-sdk.git</connection>
    <developerConnection>scm:git:ssh://github.com:dfh-digital-insight/cdx-java-sdk.git</developerConnection>
    <url>https://github.com/dfh-digital-insight/cdx-java-sdk</url>
  </scm>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.release>17</maven.compiler.release>
    <okhttp.version>4.12.0</okhttp.version>
    <gson.version>2.11.0</gson.version>
    <gson-fire.version>1.9.0</gson-fire.version>
    <junit.version>5.10.2</junit.version>
    <mockwebserver.version>4.12.0</mockwebserver.version>
    <!-- Central Publisher Portal (not legacy OSSRH staging). -->
    <central.publishing.version>0.11.0</central.publishing.version>
    <!-- Maven Central: io.github.candescent-dev; JFrog (-Pjfrog): com.candescent -->
    <publish.groupId>io.github.candescent-dev</publish.groupId>
  </properties>

  <!-- No distributionManagement: releases publish via central-publishing-maven-plugin to
       https://central.sonatype.com (see https://central.sonatype.org/publish/publish-portal-maven/). -->

  <dependencies>
    <!-- OpenAPI Generator okhttp-gson runtime -->
    <dependency>
      <groupId>com.squareup.okhttp3</groupId>
      <artifactId>okhttp</artifactId>
      <version>${okhttp.version}</version>
    </dependency>
    <dependency>
      <groupId>com.squareup.okhttp3</groupId>
      <artifactId>logging-interceptor</artifactId>
      <version>${okhttp.version}</version>
    </dependency>
    <dependency>
      <groupId>com.google.code.gson</groupId>
      <artifactId>gson</artifactId>
      <version>${gson.version}</version>
    </dependency>
    <dependency>
      <groupId>io.gsonfire</groupId>
      <artifactId>gson-fire</artifactId>
      <version>${gson-fire.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
      <version>3.18.0</version>
    </dependency>
    <dependency>
      <groupId>com.google.code.findbugs</groupId>
      <artifactId>jsr305</artifactId>
      <version>3.0.2</version>
    </dependency>
    <dependency>
      <groupId>javax.annotation</groupId>
      <artifactId>javax.annotation-api</artifactId>
      <version>1.3.2</version>
    </dependency>

    <!-- Test -->
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.squareup.okhttp3</groupId>
      <artifactId>mockwebserver</artifactId>
      <version>${mockwebserver.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <sourceDirectory>src/main/java</sourceDirectory>
    <testSourceDirectory>src/test/java</testSourceDirectory>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>3.5.0</version>
        <executions>
          <execution>
            <id>add-generated-sources</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>add-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>${project.basedir}/generated/src/main/java</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.13.0</version>
        <configuration>
          <release>${maven.compiler.release}</release>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>3.2.5</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>3.4.1</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>3.3.1</version>
        <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>
        <version>3.7.0</version>
        <configuration>
          <doclint>none</doclint>
          <source>${maven.compiler.release}</source>
        </configuration>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-deploy-plugin</artifactId>
        <version>3.1.2</version>
        <configuration>
          <!-- central-publishing-maven-plugin handles deploy; skip legacy deploy mojo. -->
          <skip>true</skip>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.sonatype.central</groupId>
        <artifactId>central-publishing-maven-plugin</artifactId>
        <version>${central.publishing.version}</version>
        <extensions>true</extensions>
        <configuration>
          <publishingServerId>central</publishingServerId>
          <centralBaseUrl>https://central.sonatype.com</centralBaseUrl>
          <autoPublish>true</autoPublish>
          <waitUntil>published</waitUntil>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>3.2.7</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <passphraseEnvName>MAVEN_GPG_PASSPHRASE</passphraseEnvName>
              <gpgArguments>
                <arg>--pinentry-mode</arg>
                <arg>loopback</arg>
              </gpgArguments>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>jfrog</id>
      <properties>
        <publish.groupId>com.candescent</publish.groupId>
      </properties>
      <distributionManagement>
        <repository>
          <id>artifactory</id>
          <url>https://candescent.jfrog.io/artifactory/digitalbanking-maven-group</url>
        </repository>
        <snapshotRepository>
          <id>artifactory</id>
          <url>https://candescent.jfrog.io/artifactory/digitalbanking-maven-group</url>
        </snapshotRepository>
      </distributionManagement>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-deploy-plugin</artifactId>
            <configuration>
              <skip>false</skip>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.sonatype.central</groupId>
            <artifactId>central-publishing-maven-plugin</artifactId>
            <extensions>false</extensions>
            <configuration>
              <skip>true</skip>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
