<?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.ksuid</groupId>
    <artifactId>ksuid</artifactId>
    <version>1.1.2</version>
    <packaging>jar</packaging>
    <name>ksuid</name>
    
    <description>
        K-Sortable Globally Unique IDs for Java
    </description>
    <url>https://github.com/ksuid/ksuid</url>
    <inceptionYear>2021</inceptionYear>
    <organization>
        <name>ksuid</name>
    </organization>
    
    <properties>
        <build.timestamp>${maven.build.timestamp}</build.timestamp>

        <!-- Plugin configuration -->
        <git-commit-id-plugin.version>4.0.3</git-commit-id-plugin.version>
        <gpg.skip>true</gpg.skip>
        <jacoco-maven-plugin.version>0.8.6</jacoco-maven-plugin.version>
        <jgitflow-maven-plugin.version>1.0-m5.1</jgitflow-maven-plugin.version>
        <maven.build.timestamp.format>yyyy-MM-dd HH:mm:ss z</maven.build.timestamp.format>
        <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
        <maven-dependency-plugin.version>3.1.2</maven-dependency-plugin.version>
        <maven-deploy-plugin.version>3.0.0-M1</maven-deploy-plugin.version>
        <maven-enforcer-plugin.version>3.0.0-M3</maven-enforcer-plugin.version>
        <maven-failsafe-plugin.version>3.0.0-M5</maven-failsafe-plugin.version>
        <maven-jar-plugin.version>3.2.0</maven-jar-plugin.version>
        <maven-source-plugin.version>3.2.1</maven-source-plugin.version>
        <maven-surefire-plugin.version>3.0.0-M5</maven-surefire-plugin.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>${project.build.sourceEncoding}</project.reporting.outputEncoding>
        <spring-boot-maven-plugin.version>2.6.3</spring-boot-maven-plugin.version>

        <!-- Specify all SonarQube code coverage reports - default does not pick up integration tests -->
        <sonar.coverage.jacoco.xmlReportPaths>target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,target/site/jacoco-aggregate/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>

        <versions-maven-plugin.version>2.7</versions-maven-plugin.version>

        <!-- Dependency versions -->
        <assertj-core.version>3.19.0</assertj-core.version>
        <commons-lang3.version>3.12.0</commons-lang3.version>
        <equalsverifier.version>2.5.2</equalsverifier.version>
        <junit.version>4.13.2</junit.version>
        <mockito.version>4.3.1</mockito.version>
    </properties>

    <licenses>
        <license>
            <name>MIT</name>
            <url>https://opensource.org/licenses/MIT</url>
            <distribution>manual</distribution>
            <comments>A business-friendly OSS license</comments>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:git://github.com/ksuid/ksuid.git</connection>
        <developerConnection>scm:git:https://github.com/ksuid/ksuid.git</developerConnection>
        <url>http://github.com/ksuid/ksuid/tree/master</url>
        <tag>ksuid-1.1.2</tag>
    </scm>
    
    <developers>
        <developer>
            <name>ksuid</name>
        </developer>
    </developers>
    
    <dependencies>
        <!-- Testing -->
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <version>${assertj-core.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>${commons-lang3.version}</version>
            <scope>test</scope>
        </dependency>
        
        <dependency>
            <groupId>nl.jqno.equalsverifier</groupId>
            <artifactId>equalsverifier</artifactId>
            <version>${equalsverifier.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-inline</artifactId>
            <version>${mockito.version}</version>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>3.0.0-M1</version>
                </plugin>
            </plugins>
        </pluginManagement>
        
        <plugins>

            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${jacoco-maven-plugin.version}</version>
                <executions>
                    <execution>
                        <id>default-prepare-agent</id>
                        <goals>
                            <goal>prepare-agent</goal>
                            <goal>prepare-agent-integration</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>default-report</id>
                        <goals>
                            <goal>report</goal>
                            <goal>report-integration</goal>
                            <goal>report-aggregate</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>${maven-failsafe-plugin.version}</version>
                <configuration>
                    <workingDirectory>${project.build.directory}</workingDirectory>
                    <classesDirectory>${project.build.outputDirectory}</classesDirectory>
                    <argLine>-Xmx1024m -Xms128m ${argLine}</argLine>
                    <runOrder>alphabetical</runOrder>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven-surefire-plugin.version}</version>
                <configuration>
                    <workingDirectory>${project.build.directory}</workingDirectory>
                    <classesDirectory>${project.build.outputDirectory}</classesDirectory>
                    <argLine>-Xmx1024m -Xms128m ${argLine}</argLine>
                    <runOrder>alphabetical</runOrder>
                </configuration>
            </plugin>

            <plugin>
                <groupId>external.atlassian.jgitflow</groupId>
                <artifactId>jgitflow-maven-plugin</artifactId>
                <version>${jgitflow-maven-plugin.version}</version>
                <!-- forces xerces dependency -->
                <dependencies>
                    <dependency>
                        <groupId>xerces</groupId>
                        <artifactId>xercesImpl</artifactId>
                        <version>2.11.0</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <enableFeatureVersions>true</enableFeatureVersions>
                    <enableSshAgent>true</enableSshAgent>
                    <pushFeatures>true</pushFeatures>
                    <pushReleases>true</pushReleases>
                    <pushHotfixes>true</pushHotfixes>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.2.0</version>
                <configuration>
                    <source>1.8</source>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>1.6</version>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>${maven-deploy-plugin.version}</version>
            </plugin>

            <!-- This plugin creates a file, git.properties -->
            <!-- https://github.com/git-commit-id/maven-git-commit-id-plugin -->
            <plugin>
                <groupId>pl.project13.maven</groupId>
                <artifactId>git-commit-id-plugin</artifactId>
                <version>${git-commit-id-plugin.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>revision</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <prefix>git</prefix>
                    <dateFormat>yyyy-MM-dd'T'HH:mm:ss.SSSZ</dateFormat>
                    <verbose>false</verbose>
                    <dotGitDirectory>${project.basedir}/.git</dotGitDirectory>
                    <generateGitPropertiesFile>true</generateGitPropertiesFile>
                    <generateGitPropertiesFilename>${project.build.outputDirectory}/git-${project.artifactId}.properties</generateGitPropertiesFilename>
                    <failOnNoGitDirectory>false</failOnNoGitDirectory>
                    <excludeProperties>
                        <excludeProperty>git.user.*</excludeProperty>
                        <excludeProperty>git.build.host</excludeProperty>
                        <excludeProperty>git.build.user.*</excludeProperty>
                        <excludeProperty>git.commit.message.*</excludeProperty>
                        <excludeProperty>git.commit.user.*</excludeProperty>
                    </excludeProperties>
                </configuration>
            </plugin>

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

            <!-- Create a source code jar of code. -->
            <!-- https://maven.apache.org/plugins/maven-source-plugin/index.html -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>${maven-source-plugin.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- Watch out for dependency convergence!! -->
            <!-- https://maven.apache.org/enforcer/maven-enforcer-plugin/index.html -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>${maven-enforcer-plugin.version}</version>
                <executions>
                    <execution>
                        <id>enforce</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <phase>validate</phase>
                    </execution>
                </executions>
                <configuration>
                    <rules>
                        <dependencyConvergence />

                        <bannedDependencies>
                            <excludes>commons-logging</excludes>
                        </bannedDependencies>
                    </rules>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>${spring-boot-maven-plugin.version}</version>
                <executions>
                    <execution>
                        <id>repackage</id>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                        <configuration>
                            <classifier>cli</classifier>
                            <executable>true</executable>
                        </configuration>
                    </execution>
                    <execution>
                        <id>build-info</id>
                        <goals>
                            <goal>build-info</goal>
                        </goals>
                        <configuration>
                            <outputFile>${project.build.outputDirectory}/META-INF/build-info-${project.artifactId}.properties</outputFile>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <!-- https://maven.apache.org/plugins/maven-jar-plugin/ -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>${maven-jar-plugin.version}</version>
                <configuration>
                    <archive>
                        <manifestEntries>
                            <Implementation-Title>${project.artifactId}</Implementation-Title>
                            <Implementation-Version>${project.version}</Implementation-Version>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>

            <!-- Keep dependencies up to date. -->
            <!-- To find the plugin versions you have to update: mvn versions:display-plugin-updates -->
            <!-- To find the dependency versions you have to update: mvn versions:display-dependency-updates -->
            <!-- https://www.mojohaus.org/versions-maven-plugin/ -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>versions-maven-plugin</artifactId>
                <version>${versions-maven-plugin.version}</version>
                <configuration>
                    <generateBackupPoms>false</generateBackupPoms>
                </configuration>
            </plugin>

            <!-- Compile code for 1.8 JVMs -->
            <!-- https://maven.apache.org/plugins/maven-compiler-plugin/index.html -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven-compiler-plugin.version}</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <parameters>true</parameters>
                    <encoding>${project.build.sourceEncoding}</encoding>
                    <showDeprecation>true</showDeprecation>
                    <compilerArgs>
                        <arg>-Xlint</arg>
                    </compilerArgs>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>
