<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.adyen</groupId>
    <artifactId>adyen-java-api-library</artifactId>
    <packaging>jar</packaging>
    <version>42.0.1</version>
    <name>Adyen Java API Library</name>
    <description>Adyen API Client Library for Java</description>
    <url>https://github.com/adyen/adyen-java-api-library</url>
    <licenses>
        <license>
            <name>MIT</name>
            <url>https://choosealicense.com/licenses/mit/</url>
        </license>
    </licenses>
    <developers>
        <developer>
            <name>Adyen</name>
            <email>devrel@adyen.com</email>
            <organization>Adyen</organization>
            <organizationUrl>https://www.adyen.com</organizationUrl>
        </developer>
    </developers>
    <properties>
        <!-- Project Settings -->
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <sonar.organization>adyen</sonar.organization>
        <sonar.host.url>https://sonarcloud.io</sonar.host.url>

        <!-- Dependency Versions -->
        <!-- Compile -->
        <com.fasterxml.jackson-version>2.21.3</com.fasterxml.jackson-version>
        <gson-version>2.14.0</gson-version>
        <commons-codec-version>1.22.0</commons-codec-version>
        <gson-fire-version>1.9.0</gson-fire-version>
        <swagger-core-version>1.6.16</swagger-core-version>
        <swagger-annotations-v3-version>2.2.49</swagger-annotations-v3-version>
        <jakarta.ws.rs-api-version>3.1.0</jakarta.ws.rs-api-version>
        <httpclient5-version>5.6.1</httpclient5-version>

        <!-- Test -->
        <okio-version>3.17.0</okio-version>
        <hamcrest-version>3.0</hamcrest-version>
        <junit-jupiter-version>5.14.4</junit-jupiter-version>
        <mockito-version>5.23.0</mockito-version>

        <!-- Plugin Versions -->
        <maven-compiler-plugin-version>3.15.0</maven-compiler-plugin-version>
        <maven-jar-plugin-version>3.5.0</maven-jar-plugin-version>
        <jacoco-maven-plugin-version>0.8.14</jacoco-maven-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-gpg-plugin-version>3.2.8</maven-gpg-plugin-version>
        <central-publishing-maven-plugin-version>0.10.0</central-publishing-maven-plugin-version>
        <maven-checkstyle-plugin-version>3.6.0</maven-checkstyle-plugin-version>
        <maven-bundle-plugin-version>5.1.9</maven-bundle-plugin-version>
        <spotless-maven-plugin-version>3.4.0</spotless-maven-plugin-version>
        <maven-surefire-plugin-version>3.5.5</maven-surefire-plugin-version>
        <google-java-format-version>1.34.1</google-java-format-version>
        <maven-enforcer-version>3.6.2</maven-enforcer-version>
    </properties>
    <scm>
        <connection>scm:git:git@github.com:Adyen/adyen-java-api-library.git</connection>
        <developerConnection>scm:git:git@github.com:Adyen/adyen-java-api-library.git</developerConnection>
        <url>git@github.com:Adyen/adyen-java-api-library.git</url>
    </scm>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven-compiler-plugin-version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>${maven-jar-plugin-version}</version>
                <configuration>
                    <archive>
                        <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${jacoco-maven-plugin-version}</version>
                <executions>
                    <execution>
                        <id>prepare-agent</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>report</id>
                        <goals>
                            <goal>report</goal>
                        </goals>
                        <configuration>
                            <formats>
                                <format>XML</format>
                            </formats>
                        </configuration>
                    </execution>
                </executions>
            </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-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${maven-javadoc-plugin-version}</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>${maven-gpg-plugin-version}</version>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!-- Publish to Sonatype (Maven Central) -->
            <plugin>
                <groupId>org.sonatype.central</groupId>
                <artifactId>central-publishing-maven-plugin</artifactId>
                <version>${central-publishing-maven-plugin-version}</version>
                <extensions>true</extensions>
                <configuration>
                    <publishingServerId>central</publishingServerId>
                    <tokenAuth>true</tokenAuth>
                    <autoPublish>true</autoPublish>
                    <waitUntil>validated</waitUntil>
                    <deploymentName>${project.artifactId}</deploymentName>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>${maven-checkstyle-plugin-version}</version>
                <configuration>
                    <configLocation>checkstyle.xml</configLocation>
                    <suppressionsLocation>checkstyle-suppressions.xml</suppressionsLocation>
                    <consoleOutput>true</consoleOutput>
                    <failsOnError>true</failsOnError>
                </configuration>
                <executions>
                    <execution>
                        <id>validate</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <version>${maven-bundle-plugin-version}</version>
                <executions>
                    <execution>
                        <id>bundle-manifest</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>manifest</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <instructions>
                        <Export-Package>com.adyen</Export-Package>
                    </instructions>
                </configuration>
            </plugin>
            <!-- Format code -->
            <plugin>
                <groupId>com.diffplug.spotless</groupId>
                <artifactId>spotless-maven-plugin</artifactId>
                <version>${spotless-maven-plugin-version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>apply</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <java>
                        <includes>
                            <include>src/main/java/**/*.java</include>
                            <include>src/test/java/**/*.java</include>
                        </includes>
                        <googleJavaFormat>
                            <version>${google-java-format-version}</version>
                            <style>GOOGLE</style>
                            <formatJavadoc>true</formatJavadoc>
                        </googleJavaFormat>
                        <importOrder/> <!-- standard import order -->
                        <removeUnusedImports>
                            <engine>google-java-format</engine>
                        </removeUnusedImports>
                    </java>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven-surefire-plugin-version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>${maven-enforcer-version}</version>
                <executions>
                    <execution>
                        <id>enforce-jakarta-compliance</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <bannedDependencies>
                                    <excludes>
                                        <exclude>javax.xml.bind:jaxb-api</exclude>

                                        <!-- Not used but keeping exclusions for Jakarta EE 9+ compatibility -->
                                        <exclude>javax.servlet:servlet-api</exclude>
                                        <exclude>javax.servlet:javax.servlet-api</exclude>
                                        <exclude>javax.persistence:javax.persistence-api</exclude>
                                        <exclude>javax.persistence:persistence-api</exclude>
                                        <exclude>javax.validation:validation-api</exclude>
                                        <exclude>javax.inject:javax.inject</exclude>
                                    </excludes>
                                    <message>
                                        STOP! A legacy javax.* dependency was detected
                                    </message>
                                </bannedDependencies>
                            </rules>
                            <fail>true</fail>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <dependencies>
        <!-- Compile -->
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>${com.fasterxml.jackson-version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.datatype</groupId>
            <artifactId>jackson-datatype-jsr310</artifactId>
            <version>${com.fasterxml.jackson-version}</version>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>${gson-version}</version>
        </dependency>
        <dependency>
            <groupId>commons-codec</groupId>
            <artifactId>commons-codec</artifactId>
            <version>${commons-codec-version}</version>
        </dependency>
        <dependency>
            <groupId>io.gsonfire</groupId>
            <artifactId>gson-fire</artifactId>
            <version>${gson-fire-version}</version>
        </dependency>
        <dependency>
            <groupId>io.swagger</groupId>
            <artifactId>swagger-annotations</artifactId>
            <version>${swagger-core-version}</version>
        </dependency>
        <dependency>
            <groupId>io.swagger.core.v3</groupId>
            <artifactId>swagger-annotations</artifactId>
            <version>${swagger-annotations-v3-version}</version>
        </dependency>
        <dependency>
            <groupId>jakarta.ws.rs</groupId>
            <artifactId>jakarta.ws.rs-api</artifactId>
            <version>${jakarta.ws.rs-api-version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents.client5</groupId>
            <artifactId>httpclient5</artifactId>
            <version>${httpclient5-version}</version>
        </dependency>

        <!-- Test -->
        <dependency>
            <groupId>com.squareup.okio</groupId>
            <artifactId>okio</artifactId>
            <version>${okio-version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest</artifactId>
            <version>${hamcrest-version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <version>${junit-jupiter-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>
</project>
