<?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>dev.andstuff.kraken</groupId>
    <artifactId>kraken-api-parent</artifactId>
    <version>2.0.0</version>
    <packaging>pom</packaging>

    <name>Java Kraken API Client</name>
    <description>A Kraken.com API client written in Java</description>
    <url>https://github.com/nyg/kraken-api-java</url>
    <inceptionYear>2015</inceptionYear>

    <licenses>
        <license>
            <name>ISC License</name>
            <url>https://github.com/nyg/kraken-api-java/blob/master/LICENSE</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>nyg</name>
            <url>https://github.com/nyg</url>
        </developer>
    </developers>

    <modules>
        <module>library</module>
        <module>examples</module>
    </modules>

    <scm>
        <url>https://github.com/nyg/kraken-api-java</url>
        <connection>scm:git:https://github.com/nyg/kraken-api-java.git</connection>
        <developerConnection>scm:git:ssh://git@github.com/nyg/kraken-api-java.git</developerConnection>
        <tag>v2.0.0</tag>
    </scm>

    <issueManagement>
        <url>https://github.com/nyg/kraken-api-java/issues</url>
        <system>GitHub Issues</system>
    </issueManagement>

    <properties>
        <maven.compiler.release>21</maven.compiler.release>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <!-- Third-party dependencies -->
        <jackson.version>2.17.0</jackson.version>
        <lombok.version>1.18.32</lombok.version>
        <slf4j.version>2.0.12</slf4j.version>
        <log4j.version>2.23.0</log4j.version>

        <!-- Maven plugins -->
        <maven-deploy-plugin.version>3.1.1</maven-deploy-plugin.version>
        <maven-gpg-plugin.version>3.2.2</maven-gpg-plugin.version>
        <maven-javadoc-plugin.version>3.6.3</maven-javadoc-plugin.version>
        <maven-release-plugin.version>3.0.1</maven-release-plugin.version>
        <maven-source-plugin.version>3.3.0</maven-source-plugin.version>

        <!-- Third-party plugins -->
        <central-publishing-maven-plugin.version>0.4.0</central-publishing-maven-plugin.version>
        <exec-maven-plugin.version>3.2.0</exec-maven-plugin.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <!-- Third-party dependencies -->
            <dependency>
                <groupId>com.fasterxml.jackson</groupId>
                <artifactId>jackson-bom</artifactId>
                <version>${jackson.version}</version>
                <scope>import</scope>
                <type>pom</type>
            </dependency>
            <dependency>
                <groupId>org.projectlombok</groupId>
                <artifactId>lombok</artifactId>
                <version>${lombok.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <!-- Third-party dependencies -->
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.datatype</groupId>
            <artifactId>jackson-datatype-jsr310</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.datatype</groupId>
            <artifactId>jackson-datatype-jdk8</artifactId>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>${exec-maven-plugin.version}</version>
                <configuration>
                    <executable>./scripts/generate-changelog.sh</executable>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>${maven-release-plugin.version}</version>
                <configuration>
                    <!-- release:prepare -->
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <preparationGoals>clean verify exec:exec</preparationGoals>
                    <!-- @formatter:off -->
                    <scmCommentPrefix>chore(release): </scmCommentPrefix>
                    <!-- @formatter:on -->
                    <signTag>true</signTag>
                    <tagNameFormat>v@{version}</tagNameFormat>

                    <!-- release:perform -->
                    <releaseProfiles>maven-central</releaseProfiles>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>maven-central</id>
            <build>
                <plugins>
                    <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-no-fork</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>
                            </execution>
                        </executions>
                    </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>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <keyname>F8E60A60EB7F12AA</keyname>
                        </configuration>
                    </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>
                            <tokenAuth>true</tokenAuth>
                            <excludeArtifacts>
                                <artifact>kraken-api-examples</artifact>
                            </excludeArtifacts>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
