<?xml version="1.0" encoding="UTF-8"?>

<!--
SPDX-FileCopyrightText: 2022 FIT-Connect contributors <fit-connect@fitko.de>

SPDX-License-Identifier: CC0-1.0
-->

<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://maven.apache.org/POM/4.0.0"
         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.fitko.fitconnect</groupId>
    <artifactId>jwkvalidator</artifactId>
    <version>2.3.1</version>
    <packaging>jar</packaging>

    <name>JWK-Validator</name>
    <description>Library for validation of JWKs in the context of FIT-Connect</description>
    <url>https://git.fitko.de/fit-connect/jwk-validator</url>

    <licenses>
        <license>
            <name>EUPL-1.2</name>
            <url>https://joinup.ec.europa.eu/page/eupl-text-11-12</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>FIT-Connect Contributors</name>
            <email>fit-connect@fitko.de</email>
            <organization>FITKO</organization>
            <organizationUrl>https://www.fitko.de</organizationUrl>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:https://git.fitko.de/fit-connect/jwk-validator.git</connection>
        <developerConnection>scm:git:https://git.fitko.de/fit-connect/jwk-validator.git</developerConnection>
        <url>https://git.fitko.de/fit-connect/jwk-validator</url>
    </scm>

    <properties>
        <java.version>11</java.version>
        <encoding>UTF-8</encoding>
        <project.build.sourceEncoding>${encoding}</project.build.sourceEncoding>
        <project.reporting.outputEncoding>${encoding}</project.reporting.outputEncoding>
        <maven.compiler.release>${java.version}</maven.compiler.release>

        <!-- DEPENDENCIES -->
        <bouncycastle.version>1.81</bouncycastle.version>
        <nimbusds.version>10.4</nimbusds.version>
        <slf4j.version>1.7.36</slf4j.version>
        <!-- Test only -->
        <awaitility.version>4.3.0</awaitility.version>
        <junit.version>5.13.4</junit.version>
        <mockito.version>5.18.0</mockito.version>

        <!-- PLUGINS -->
        <spotless.version>2.44.5</spotless.version>
        <!-- Deployment -->
        <maven.gpg-plugin>3.2.8</maven.gpg-plugin>
        <maven.javadoc-plugin>3.11.2</maven.javadoc-plugin>
        <maven.source-plugin>3.3.1</maven.source-plugin>
        <maven.central-publishing>0.8.0</maven.central-publishing>
        <!-- Testing -->
        <maven.surefire-plugin>3.5.3</maven.surefire-plugin>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.bouncycastle</groupId>
            <artifactId>bcpkix-jdk18on</artifactId>
            <version>${bouncycastle.version}</version>
        </dependency>
        <dependency>
            <groupId>org.bouncycastle</groupId>
            <artifactId>bcprov-jdk18on</artifactId>
            <version>${bouncycastle.version}</version>
        </dependency>
        <dependency>
            <groupId>com.nimbusds</groupId>
            <artifactId>nimbus-jose-jwt</artifactId>
            <version>${nimbusds.version}</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${slf4j.version}</version>
        </dependency>
        <!--Test only-->
        <dependency>
            <groupId>org.awaitility</groupId>
            <artifactId>awaitility</artifactId>
            <version>${awaitility.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </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-junit-jupiter</artifactId>
            <version>${mockito.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>com.diffplug.spotless</groupId>
                <artifactId>spotless-maven-plugin</artifactId>
                <version>${spotless.version}</version>
                <configuration>
                    <!-- optional: limit format enforcement to just the files changed by this feature branch -->
                    <!-- <ratchetFrom>origin/main</ratchetFrom> -->
                    <formats>
                        <!-- you can define as many formats as you want, each is independent -->
                        <format>
                            <!-- define the files to apply to -->
                            <includes>
                                <include>.gitattributes</include>
                                <include>.gitignore</include>
                            </includes>
                            <!-- define the steps to apply to those files -->
                            <trimTrailingWhitespace/>
                            <endWithNewline/>
                            <indent>
                                <tabs>true</tabs>
                                <spacesPerTab>4</spacesPerTab>
                            </indent>
                        </format>
                    </formats>
                    <!-- define a language-specific format -->
                    <java>
                        <!-- no need to specify files, inferred automatically, but you can if you want -->

                        <palantirJavaFormat>
                            <style>PALANTIR</style>
                            <formatJavadoc>false</formatJavadoc>
                        </palantirJavaFormat>
                    </java>
                </configuration>
                <executions>
                    <execution>
                        <id>apply-codestyle-on-validate</id>
                        <goals>
                            <goal>apply</goal>
                        </goals>
                        <phase>validate</phase>
                    </execution>
                    <execution>
                        <id>check-codestyle-on-compile</id>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <phase>compile</phase>
                    </execution>
                    <execution>
                        <id>check-codestyle-on-test</id>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <phase>test</phase>
                    </execution>
                </executions>
            </plugin>
            <!-- deployment -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>${maven.gpg-plugin}</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-javadoc-plugin</artifactId>
                <version>${maven.javadoc-plugin}</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>${maven.source-plugin}</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.sonatype.central</groupId>
                <artifactId>central-publishing-maven-plugin</artifactId>
                <version>${maven.central-publishing}</version>
                <extensions>true</extensions>
                <configuration>
                    <publishingServerId>central</publishingServerId>
                    <autoPublish>true</autoPublish>
                </configuration>
            </plugin>
            <!-- testing -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven.surefire-plugin}</version>
                <configuration>
                    <failIfNoTests>true</failIfNoTests>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

</project>
