<?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>com.github.jamesnetherton</groupId>
    <artifactId>zulip-java-client</artifactId>
    <version>0.7.2</version>
    <packaging>jar</packaging>

    <name>Zulip Java Client</name>
    <description>Java client for the Zulip REST API</description>
    <url>https://github.com/jamesnetherton/zulip-java-client</url>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.build.reportEncoding>UTF-8</project.build.reportEncoding>

        <!-- Project dependency versions -->
        <httpcomponents.version>5.4.1</httpcomponents.version>
        <jackson.version>2.18.2</jackson.version>
        <junit.jupiter.version>5.11.3</junit.jupiter.version>
        <slf4j.version>2.0.16</slf4j.version>
        <wiremock.version>3.10.0</wiremock.version>

        <!-- Plugin versions -->
        <formatter.plugin.version>2.18.0</formatter.plugin.version>
        <impsort.plugin.version>1.9.0</impsort.plugin.version>
        <maven.compiler.plugin.version>3.13.0</maven.compiler.plugin.version>
        <maven.failsafe.plugin.version>3.5.2</maven.failsafe.plugin.version>
        <maven.gpg.plugin.version>3.2.7</maven.gpg.plugin.version>
        <maven.javadoc.plugin.version>3.11.2</maven.javadoc.plugin.version>
        <maven.release.plugin.version>3.1.1</maven.release.plugin.version>
        <maven.source.plugin.version>3.3.1</maven.source.plugin.version>
        <maven.surefire.plugin.version>3.5.2</maven.surefire.plugin.version>
    </properties>

    <scm>
        <connection>scm:git:git://github.com/jamesnetherton/zulip-java-client.git</connection>
        <developerConnection>scm:git:git@github.com:jamesnetherton/zulip-java-client.git</developerConnection>
        <url>${project.url}</url>
        <tag>0.7.2</tag>
    </scm>

    <developers>
        <developer>
            <name>James Netherton</name>
            <url>https://github.com/jamesnetherton</url>
            <timezone>0</timezone>
        </developer>
    </developers>

    <issueManagement>
        <url>https://github.com/jamesnetherton/zulip-java-client/issues</url>
        <system>GitHub</system>
    </issueManagement>

    <licenses>
        <license>
            <name>Apache 2.0</name>
            <url>https://opensource.org/licenses/Apache-2.0</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <distributionManagement>
        <repository>
            <id>oss-sonatype-staging</id>
            <name>Sonatype Staging Repository</name>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
        </repository>
        <snapshotRepository>
            <id>oss-sonatype-snapshots</id>
            <name>OSS Sonatype Nexus Snapshots</name>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

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

    <dependencies>
        <dependency>
            <groupId>com.fasterxml.jackson.datatype</groupId>
            <artifactId>jackson-datatype-jsr310</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents.client5</groupId>
            <artifactId>httpclient5</artifactId>
            <version>${httpcomponents.version}</version>
        </dependency>

        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <version>${junit.jupiter.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.wiremock</groupId>
            <artifactId>wiremock</artifactId>
            <version>${wiremock.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${slf4j.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-nop</artifactId>
            <version>${slf4j.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven.compiler.plugin.version}</version>
                <configuration>
                    <source>11</source>
                    <target>11</target>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>${maven.failsafe.plugin.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <excludedGroups>slow</excludedGroups>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-release-plugin</artifactId>
                <version>${maven.release.plugin.version}</version>
                <configuration>
                    <tagNameFormat>@{project.version}</tagNameFormat>
                    <releaseProfiles>release</releaseProfiles>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <preparationGoals>clean install</preparationGoals>
                    <arguments>-DskipTests -Dformatter.skip -Dimpsort.skip</arguments>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven.surefire.plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>net.revelc.code.formatter</groupId>
                <artifactId>formatter-maven-plugin</artifactId>
                <version>${formatter.plugin.version}</version>
                <configuration>
                    <configFile>eclipse-format.xml</configFile>
                    <lineEnding>LF</lineEnding>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>format</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>net.revelc.code</groupId>
                <artifactId>impsort-maven-plugin</artifactId>
                <version>${impsort.plugin.version}</version>
                <executions>
                    <execution>
                        <id>sort-imports</id>
                        <goals>
                            <goal>sort</goal>
                        </goals>
                        <configuration>
                            <removeUnused>true</removeUnused>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${maven.gpg.plugin.version}</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <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>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>${maven.javadoc.plugin.version}</version>
                        <configuration>
                            <doclint>none</doclint>
                            <encoding>${project.build.sourceEncoding}</encoding>
                            <javadocExecutable>${java.home}/bin/javadoc</javadocExecutable>
                            <release>11</release>
                        </configuration>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
