<?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>br.com.competeaqui</groupId>
    <artifactId>pagseguro-api</artifactId>
    <version>1.0.2</version>

    <name>PagSeguro Java API</name>
    <description>
        Biblioteca Java para consumo da API de pagamentos do PagSeguro (PagBank)
    </description>
    <url>https://github.com/competeaqui/pagseguro-java-api</url>

    <inceptionYear>2023</inceptionYear>

    <licenses>
        <license>
            <name>GPLv3</name>
            <url>http://www.gnu.org/licenses/gpl-3.0.txt</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Manoel Campos da Silva Filho</name>
            <email>manoelcampos@gmail.com</email>
            <organization>Compete Aqui</organization>
            <organizationUrl>http://competeaqui.com.br</organizationUrl>
        </developer>
        <developer>
            <name>Fagno Alves Fonseca</name>
            <email>fagno.fonseca@gmail.com</email>
            <organization>Compete Aqui</organization>
            <organizationUrl>http://competeaqui.com.br</organizationUrl>
        </developer>
    </developers>

    <profiles>
        <profile>
            <!--
             A profile used to execute all goals required to deploy
             the project to the Maven Central.
             To execute use: mvn clean deploy -P sonatype

             To check the deployed artifact and probably release it to maven central
             you should visit https://oss.sonatype.org.
             MAKE SURE YOU ARE LOGGED IN TO SEE YOUR DEPLOYMENTS.
             -->
            <id>sonatype</id>

            <!--
            URLs to deploy the project at the Maven Central (http://mvnrepository.com)
            using a Sonatype account (http://central.sonatype.org)
            See the "all" profile in this pom for deployment information.
            -->
            <distributionManagement>
                <snapshotRepository>
                    <id>ossrh</id>
                    <url>https://oss.sonatype.org/content/repositories/snapshots</url>
                </snapshotRepository>
                <repository>
                    <id>ossrh</id>
                    <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
                </repository>
            </distributionManagement>

            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <!-- Forking the process was causing runtime exceptions
                             when running tests with Java 10+ -->
                            <forkCount>0</forkCount>
                        </configuration>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>3.2.1</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <failOnError>false</failOnError>
                        </configuration>
                    </plugin>

                    <!--
                     Signs the generated jar using GPG, as required for deploying at the Maven Central.
                     Configurations are defined into the local repo settings.xml
                    -->
                    <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>
                                <configuration>
                                    <!-- Prevent `gpg` from using pinentry programs
                                    and avoid "gpg: signing failed: Inappropriate ioctl for device" error. -->
                                    <gpgArguments>
                                        <arg>--pinentry-mode</arg>
                                        <arg>loopback</arg>
                                    </gpgArguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <!--
                    Plugin to deploy to the maven central using a Sonatype account.
                    Credentials are defined into the local repo settings.xml
                    -->
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.13</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>competeaqui-ossrh</serverId>
                            <!-- URL para administração de artefatos publicados (definida pela equipe do sonatype) -->
                            <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
                            <!--If the artifact will be automatically released to maven central after the upload to sonatype.-->
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <scm>
        <connection>scm:git:git@github.com:competeaqui/pagseguro-java-api.git</connection>
        <developerConnection>scm:git:git@github.com:competeaqui/pagseguro-java-api.git</developerConnection>
        <url>git@github.com:competeaqui/pagseguro-java-api.git</url>
    </scm>

    <issueManagement>
        <url>https://github.com/competeaqui/pagseguro-java-api/issues</url>
        <system>GitHub Issues</system>
    </issueManagement>

    <properties>
        <maven.compiler.source>17</maven.compiler.source>
        <maven.compiler.target>17</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <build>
        <plugins>
            <!-- Necessário para executar o JUnit em projetos Maven -->
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.0.0-M7</version>
            </plugin>

            <!-- Necessário para executar o JUnit em projetos Maven -->
            <plugin>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>3.0.0-M7</version>
            </plugin>

            <plugin>
                <!-- Computar cobertura de código -->
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.8.10</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>prepare-agent</goal>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>io.github.cdimascio</groupId>
            <artifactId>dotenv-java</artifactId>
            <version>3.0.0</version>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>1.18.28</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>2.15.0</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.datatype</groupId>
            <artifactId>jackson-datatype-jsr310</artifactId>
            <version>2.15.0</version>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <version>5.9.2</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>