<?xml version="1.0" encoding="UTF-8"?>
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <!-- Project information ======================================================================================= -->
    <groupId>tech.mogami.commons</groupId>
    <artifactId>mogami-x402-commons</artifactId>
    <version>2.0.1</version>
    <packaging>jar</packaging>
    <name>Mogami x402 commons - x402 V2</name>
    <description>Provides core classes, enums, constants, and API definitions required to implement the x402 protocol
    </description>
    <url>https://github.com/mogami-tech/x402-commons</url>
    <licenses>
        <license>
            <name>Apache-2.0 license</name>
            <url>https://github.com/mogami-tech/x402-commons/blob/development/LICENSE</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <!-- Developers ================================================================================================ -->
    <developers>
        <developer>
            <id>straumat</id>
            <email>mogami.unsheathe942@passmail.net</email>
            <name>Stéphane Traumat</name>
            <url>https://github.com/straumat</url>
        </developer>
    </developers>

    <!-- Source Code Management ==================================================================================== -->
    <scm>
        <url>https://github.com/mogami-tech/x402-commons</url>
        <connection>scm:git:git://github.com/mogami-tech/x402-commons.git</connection>
        <developerConnection>scm:git:git@github.com:mogami-tech/x402-commons.git</developerConnection>
    </scm>

    <!-- Issue management ========================================================================================== -->
    <issueManagement>
        <system>GitHub Issues</system>
        <url>https://github.com/mogami-tech/x402-commons/issues</url>
    </issueManagement>

    <!-- Project configuration ===================================================================================== -->
    <properties>
        <!-- Java build configuration  -->
        <java.version>21</java.version>
        <maven.compiler.target>21</maven.compiler.target>
        <maven.compiler.source>21</maven.compiler.source>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

        <!-- Boilerplate & Utils -->
        <lombok.version>1.18.44</lombok.version>
        <commons-lang3.version>3.17.0</commons-lang3.version>
        <commons-text.version>1.15.0</commons-text.version>
        <commons-codec.version>1.21.0</commons-codec.version>
        <commons-collections.version>4.5.0</commons-collections.version>
        <jspecify.version>1.0.0</jspecify.version>

        <!-- Core JSON & Validation -->
        <jackson.version>2.21.2</jackson.version>
        <jakarta.validation.version>3.1.1</jakarta.validation.version>
        <hibernate.validator.version>9.1.0.Final</hibernate.validator.version>
        <tomcat-embed-el.version>11.0.21</tomcat-embed-el.version>
        <jakarta.el.version>6.0.1</jakarta.el.version>

        <!-- Crypto & Blockchain -->
        <web3j.crypto.version>4.14.0</web3j.crypto.version>
        <web3j.utils.version>4.14.1</web3j.utils.version>

        <!-- API & documentation -->
        <swagger.version>2.2.46</swagger.version>

        <!-- Test dependencies  -->
        <junit-jupiter.version>5.10.2</junit-jupiter.version>
        <junit-pionner.version>2.3.0</junit-pionner.version>
        <assertj.version>3.27.7</assertj.version>

        <!-- Maven plugins -->
        <maven.checkstyle.plugin.version>3.6.0</maven.checkstyle.plugin.version>
        <maven.puppycrawl.checkstyle.version>13.4.0</maven.puppycrawl.checkstyle.version>
        <maven.resources.plugin.version>3.3.1</maven.resources.plugin.version>
        <maven.compiler.plugin.version>3.15.0</maven.compiler.plugin.version>
        <maven.surefire.plugin.version>3.5.5</maven.surefire.plugin.version>
        <maven.surefire-junit5-tree-reporter.version>1.5.1</maven.surefire-junit5-tree-reporter.version>
        <maven.jar.plugin.version>3.5.0</maven.jar.plugin.version>
        <maven.source.plugin.version>3.4.0</maven.source.plugin.version>
        <maven.javadoc.plugin.version>3.12.0</maven.javadoc.plugin.version>
        <maven.archetype-packaging.version>3.2.1</maven.archetype-packaging.version>
        <maven.gitflow-maven-plugin.version>1.21.0</maven.gitflow-maven-plugin.version>
        <maven.gpg-plugin.version>3.2.8</maven.gpg-plugin.version>
        <maven.deploy-plugin.version>3.1.4</maven.deploy-plugin.version>
        <maven.central-publishing-maven-plugin.version>0.10.0</maven.central-publishing-maven-plugin.version>
    </properties>

    <!-- Dependencies ============================================================================================== -->
    <dependencies>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>${lombok.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>${commons-lang3.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-text</artifactId>
            <version>${commons-text.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-collections4</artifactId>
            <version>${commons-collections.version}</version>
        </dependency>
        <dependency>
            <groupId>commons-codec</groupId>
            <artifactId>commons-codec</artifactId>
            <version>${commons-codec.version}</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate.validator</groupId>
            <artifactId>hibernate-validator</artifactId>
            <version>${hibernate.validator.version}</version>
        </dependency>
        <dependency>
            <groupId>jakarta.validation</groupId>
            <artifactId>jakarta.validation-api</artifactId>
            <version>${jakarta.validation.version}</version>
        </dependency>
        <dependency>
            <groupId>jakarta.el</groupId>
            <artifactId>jakarta.el-api</artifactId>
            <version>${jakarta.el.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.tomcat.embed</groupId>
            <artifactId>tomcat-embed-el</artifactId>
            <version>${tomcat-embed-el.version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>${jackson.version}</version>
        </dependency>
        <dependency>
            <groupId>io.swagger.core.v3</groupId>
            <artifactId>swagger-annotations</artifactId>
            <version>${swagger.version}</version>
        </dependency>

        <dependency>
            <groupId>org.web3j</groupId>
            <artifactId>core</artifactId>
            <version>${web3j.crypto.version}</version>
        </dependency>
        <dependency>
            <groupId>org.web3j</groupId>
            <artifactId>crypto</artifactId>
            <version>${web3j.crypto.version}</version>
        </dependency>
        <dependency>
            <groupId>org.web3j</groupId>
            <artifactId>utils</artifactId>
            <version>${web3j.utils.version}</version>
        </dependency>

        <dependency>
            <groupId>org.jspecify</groupId>
            <artifactId>jspecify</artifactId>
            <version>${jspecify.version}</version>
            <scope>provided</scope>
        </dependency>

        <!-- Test dependencies -->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>${junit-jupiter.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit-pioneer</groupId>
            <artifactId>junit-pioneer</artifactId>
            <version>${junit-pionner.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <version>${assertj.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <!-- Build configuration ======================================================================================= -->
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven.compiler.plugin.version}</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                    <compilerArgs>
                        <arg>-parameters</arg>
                    </compilerArgs>
                    <showWarnings>true</showWarnings>
                    <showDeprecation>true</showDeprecation>
                    <proc>full</proc>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>${maven.checkstyle.plugin.version}</version>
                <dependencies>
                    <dependency>
                        <groupId>com.puppycrawl.tools</groupId>
                        <artifactId>checkstyle</artifactId>
                        <version>${maven.puppycrawl.checkstyle.version}</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <phase>process-sources</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <consoleOutput>true</consoleOutput>
                    <configLocation>https://mogami.tech/shared/checkstyle.xml</configLocation>
                    <failOnViolation>true</failOnViolation>
                    <violationSeverity>warning</violationSeverity>
                    <excludes>**/crypto/contract/**/*</excludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven.surefire.plugin.version}</version>
                <dependencies>
                    <dependency>
                        <groupId>me.fabriciorby</groupId>
                        <artifactId>maven-surefire-junit5-tree-reporter</artifactId>
                        <version>${maven.surefire-junit5-tree-reporter.version}</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <argLine>
                        --add-opens java.base/java.util=ALL-UNNAMED
                        --add-opens java.base/java.lang=ALL-UNNAMED
                    </argLine>
                    <reportFormat>plain</reportFormat>
                    <consoleOutputReporter>
                        <disable>true</disable>
                    </consoleOutputReporter>
                    <statelessTestsetInfoReporter
                            implementation="org.apache.maven.plugin.surefire.extensions.junit5.JUnit5StatelessTestsetInfoTreeReporter">
                    </statelessTestsetInfoReporter>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>${maven.jar.plugin.version}</version>
                <configuration>
                    <archive>
                        <manifestEntries>
                            <Implementation-Version>${project.version}</Implementation-Version>
                        </manifestEntries>
                    </archive>
                </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>
                    <detectOfflineLinks>false</detectOfflineLinks>
                    <javadocExecutable>${java.home}/bin/javadoc</javadocExecutable>
                    <failOnError>false</failOnError>
                    <quiet>true</quiet>
                    <additionalOptions>-Xdoclint:none</additionalOptions>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>${maven.deploy-plugin.version}</version>
                <configuration>
                    <skip>true</skip>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.amashchenko.maven.plugin</groupId>
                <artifactId>gitflow-maven-plugin</artifactId>
                <version>${maven.gitflow-maven-plugin.version}</version>
                <configuration>
                    <skipTestProject>true</skipTestProject>
                    <gitFlowConfig>
                        <productionBranch>production</productionBranch>
                        <developmentBranch>development</developmentBranch>
                    </gitFlowConfig>
                    <commitMessages>
                        <featureStartMessage>Update versions for feature branch</featureStartMessage>
                        <featureFinishMessage>Update versions for development branch</featureFinishMessage>
                        <hotfixStartMessage>Update versions for hotfix</hotfixStartMessage>
                        <hotfixFinishMessage>Update for next development version</hotfixFinishMessage>
                        <releaseStartMessage>Update versions for release</releaseStartMessage>
                        <releaseFinishMessage>Update for next development version</releaseFinishMessage>
                        <tagHotfixMessage>Tag hotfix</tagHotfixMessage>
                        <tagReleaseMessage>Tag release</tagReleaseMessage>
                    </commitMessages>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <!-- Profiles ================================================================================================== -->
    <profiles>
        <profile>
            <id>release</id>
            <properties>
                <gpg.keyname>E0DD5818315C8CF0DD4B20532DEEE03FA733B1CE</gpg.keyname>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${maven.gpg-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>sign-release</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <configuration>
                                    <!-- Prevent `gpg` from using pinentry programs -->
                                    <gpgArguments>
                                        <arg>--pinentry-mode</arg>
                                        <arg>loopback</arg>
                                    </gpgArguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                        <version>${maven.central-publishing-maven-plugin.version}</version>
                        <extensions>true</extensions>
                        <configuration>
                            <publishingServerId>central</publishingServerId>
                            <autoPublish>true</autoPublish>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <!-- Distribution management ==================================================================================== -->
    <distributionManagement>
        <repository>
            <id>central</id>
            <url>https://central.sonatype.com/</url>
        </repository>
        <snapshotRepository>
            <id>central</id>
            <url>https://central.sonatype.com/repository/maven-snapshots/</url>
        </snapshotRepository>
    </distributionManagement>

</project>