<?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.dnastack</groupId>
    <artifactId>dnastack-token-validator</artifactId>
    <version>4.0.1</version> <!-- All modules match this version. Keep it at 1.0.0-SNAPSHOT. The CI build updates it globally at build time to the value of `git describe`. -->

    <name>dnastack-token-validator</name>
    <description>Validates DNAstack access tokens.</description>
    <url>https://github.com/DNAstack/java-open-source-libraries</url>

    <licenses>
        <license>
            <name>The Apache License, Version 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Max Barkley</name>
            <email>max@dnastack.com</email>
            <organization>DNAstack</organization>
            <organizationUrl>https://www.dnastack.com</organizationUrl>
        </developer>
        <developer>
            <name>Jan Faron</name>
            <email>jan@dnastack.com</email>
            <organization>DNAstack</organization>
            <organizationUrl>https://www.dnastack.com</organizationUrl>
        </developer>
        <developer>
            <name>Jakub Stromsky</name>
            <email>jakub@dnastack.com</email>
            <organization>DNAstack</organization>
            <organizationUrl>https://www.dnastack.com</organizationUrl>
        </developer>
        <developer>
            <name>A N M Bazlur Rahman</name>
            <email>anmbazlur@dnastack.com</email>
            <organization>DNAstack</organization>
            <organizationUrl>https://www.dnastack.com</organizationUrl>
        </developer>
    </developers>

    <properties>
        <java.version>21</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <maven.compiler.source>${java.version}</maven.compiler.source>
        <maven.compiler.target>${java.version}</maven.compiler.target>
        <maven.compiler.plugin.version>3.15.0</maven.compiler.plugin.version>
        <maven.surefile.plugin.version>3.5.5</maven.surefile.plugin.version>
        <maven.source-plugin.version>3.4.0</maven.source-plugin.version>
        <maven.javadoc-plugin.version>3.12.0</maven.javadoc-plugin.version>
        <sign-maven-plugin.version>1.1.0</sign-maven-plugin.version>
        <!-- Sonar -->
        <sonar.maven.plugin.version>3.11.0.3922</sonar.maven.plugin.version>
        <sonar.sources>src/main</sonar.sources>
        <sonar.tests.inclusions>src/test</sonar.tests.inclusions>
        <sonar.exclusions>ci</sonar.exclusions>
        <sonar.scm.disabled>true</sonar.scm.disabled>
        <sonar.coverage.jacoco.xmlReportPaths>target/site/jacoco/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
        <!-- Other -->
        <lombok.version>1.18.44</lombok.version>
        <jjwt.version>0.13.0</jjwt.version>
        <jackson.version>2.18.6</jackson.version>
        <bouncycastle.version>1.84</bouncycastle.version>
        <okhttp3.version>4.12.0</okhttp3.version>
        <opentelemetry.version>1.61.0</opentelemetry.version>
        <feign.version>13.1</feign.version>
        <feign-form.version>3.8.0</feign-form.version>
        <micrometer-tracing.version>1.6.5</micrometer-tracing.version>
        <junit.version>5.14.3</junit.version>
        <mockito.version>5.23.0</mockito.version>
        <assertj.version>3.27.7</assertj.version>
        <jacoco.version>0.8.14</jacoco.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>io.micrometer</groupId>
                <artifactId>micrometer-tracing-bom</artifactId>
                <version>${micrometer-tracing.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>io.opentelemetry</groupId>
                <artifactId>opentelemetry-bom</artifactId>
                <version>${opentelemetry.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.junit</groupId>
                <artifactId>junit-bom</artifactId>
                <version>${junit.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <!-- Development Tools -->
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>${lombok.version}</version>
            <scope>provided</scope>
        </dependency>

        <!-- JSON Web Token Support -->
        <dependency>
            <groupId>io.jsonwebtoken</groupId>
            <artifactId>jjwt-api</artifactId>
            <version>${jjwt.version}</version>
        </dependency>
        <dependency>
            <groupId>io.jsonwebtoken</groupId>
            <artifactId>jjwt-impl</artifactId>
            <version>${jjwt.version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>io.jsonwebtoken</groupId>
            <artifactId>jjwt-jackson</artifactId>
            <version>${jjwt.version}</version>
            <scope>runtime</scope>
        </dependency>

        <!-- Jackson -->
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
            <version>${jackson.version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>${jackson.version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
            <version>${jackson.version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.datatype</groupId>
            <artifactId>jackson-datatype-jsr310</artifactId>
            <version>${jackson.version}</version>
        </dependency>

        <!-- Crypto Ext. -->
        <dependency>
            <groupId>org.bouncycastle</groupId>
            <artifactId>bcpkix-jdk18on</artifactId>
            <version>${bouncycastle.version}</version>
        </dependency>

        <!-- Feign -->
        <dependency>
            <groupId>io.github.openfeign</groupId>
            <artifactId>feign-core</artifactId>
            <version>${feign.version}</version>
        </dependency>
        <dependency>
            <groupId>io.github.openfeign</groupId>
            <artifactId>feign-okhttp</artifactId>
            <version>${feign.version}</version>
        </dependency>
        <dependency>
            <groupId>io.github.openfeign</groupId>
            <artifactId>feign-slf4j</artifactId>
            <version>${feign.version}</version>
        </dependency>
        <dependency>
            <groupId>io.github.openfeign</groupId>
            <artifactId>feign-jackson</artifactId>
            <version>${feign.version}</version>
        </dependency>
        <dependency>
            <groupId>io.github.openfeign.form</groupId>
            <artifactId>feign-form</artifactId>
            <version>${feign-form.version}</version>
        </dependency>
        <dependency>
            <groupId>com.squareup.okhttp3</groupId>
            <artifactId>logging-interceptor</artifactId>
            <version>${okhttp3.version}</version>
        </dependency>
        <!-- Observation -->
        <dependency>
            <groupId>io.micrometer</groupId>
            <artifactId>micrometer-observation</artifactId>
        </dependency>
        <dependency>
            <groupId>io.micrometer</groupId>
            <artifactId>micrometer-core</artifactId>
        </dependency>
        <dependency>
            <groupId>io.micrometer</groupId>
            <artifactId>micrometer-tracing</artifactId>
        </dependency>

        <!-- Test -->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-params</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-junit-jupiter</artifactId>
            <version>${mockito.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.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <version>${assertj.version}</version>
            <scope>test</scope>
        </dependency>

        <!-- Test: OTel bridge for Micrometer Observations -->
        <dependency>
            <groupId>io.micrometer</groupId>
            <artifactId>micrometer-tracing-bridge-otel</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.opentelemetry</groupId>
            <artifactId>opentelemetry-sdk</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.opentelemetry</groupId>
            <artifactId>opentelemetry-sdk-testing</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.squareup.okhttp3</groupId>
            <artifactId>mockwebserver</artifactId>
            <version>${okhttp3.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.jacoco</groupId>
            <artifactId>org.jacoco.agent</artifactId>
            <classifier>runtime</classifier>
            <version>${jacoco.version}</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven.compiler.plugin.version}</version>
                <configuration>
                    <!-- Annotation processing is needed by Lombok -->
                    <compilerArgs>
                        <arg>-proc:full</arg>
                    </compilerArgs>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven.surefile.plugin.version}</version>
                <configuration>
                    <argLine>-ea @{argLine}</argLine>
                </configuration>
            </plugin>
            <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</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${maven.javadoc-plugin.version}</version>
                <configuration>
                    <javadocExecutable>${java.home}/bin/javadoc</javadocExecutable>
                    <!-- Suppress "no comment" floods; keep real checks like malformed @param/@return tags. -->
                    <doclint>all,-missing</doclint>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.sonarsource.scanner.maven</groupId>
                <artifactId>sonar-maven-plugin</artifactId>
                <version>${sonar.maven.plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${jacoco.version}</version>
                <executions>
                    <execution>
                        <id>prepare-agent</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>report</id>
                        <phase>test</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <!-- Signs artifacts when SIGN_KEY/SIGN_KEY_PASS env vars are set; skips otherwise so
                     local builds work without a key. CI must set those vars to produce signed jars. -->
                <groupId>org.simplify4u.plugins</groupId>
                <artifactId>sign-maven-plugin</artifactId>
                <version>${sign-maven-plugin.version}</version>
                <configuration>
                    <skipNoKey>true</skipNoKey>
                </configuration>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <!-- Activate to deploy this module to DNAstack's private GitHub Packages Maven repo. -->
        <profile>
            <id>dnastack-gh-packages</id>
            <distributionManagement>
                <repository>
                    <id>github</id>
                    <name>GitHub DNAstack Apache Maven Packages</name>
                    <url>https://maven.pkg.github.com/DNAstack/dnastack-packages</url>
                </repository>
            </distributionManagement>
        </profile>
    </profiles>

    <scm>
        <connection>scm:git:https://github.com/DNAstack/java-open-source-libraries.git</connection>
        <developerConnection>scm:git:ssh://git@github.com/DNAstack/java-open-source-libraries.git</developerConnection>
        <url>https://github.com/DNAstack/java-open-source-libraries/tree/main</url>
    </scm>

</project>
