<?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>tech.lastbox.lastshield</groupId>
    <artifactId>LastShield</artifactId>
    <version>1.0.3</version>
    <packaging>pom</packaging>

    <name>LastShield Framework</name>
    <description>Security Framework that gives security and practicality, letting focus on the real important part: Development</description>
    <url>https://github.com/LastBoxLabel/LastShieldDocs</url>

    <!-- Licença -->
    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0</url>
        </license>
    </licenses>

    <!-- Desenvolvedores -->
    <developers>
        <developer>
            <id>aleschopf</id>
            <name>Alecsandro Schopf Auer Junior</name>
            <email>alecsandroauer@gmail.com</email>
        </developer>
        <developer>
            <id>mathlimam</id>
            <name>Matheus Lima Moreira</name>
            <email>math.lima.m@gmail.com</email>
        </developer>
        <developer>
            <id>lsmoraes16</id>
            <name>Lucas Moraes</name>
            <email>lsmoraes16.lm@gmail.com</email>
        </developer>
    </developers>

    <!-- SCM -->
    <scm>
        <connection>https://github.com/LastBoxLabel/LastShieldDocs.git</connection>
        <developerConnection>scm:git:ssh://git@github.com:LastBoxLabel/LastShieldDocs.git</developerConnection>
        <url>https://github.com/LastBoxLabel/LastShieldDocs.git</url>
    </scm>

    <!-- Módulos -->
    <modules>
        <module>security-core</module>
        <module>security-jwt</module>
        <module>security-config</module>
        <module>basic-auth</module>
    </modules>

    <!-- Gerenciamento de dependências (deve ser herdado pelos módulos) -->
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>3.3.5</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <!-- Gerenciamento de propriedades -->
    <properties>
        <maven.compiler.source>21</maven.compiler.source>
        <maven.compiler.target>21</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <!-- Build e plugins -->
    <build>
        <pluginManagement>
            <plugins>
                <!-- Plugin de compilação -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.11.0</version>
                    <configuration>
                        <source>${maven.compiler.source}</source>
                        <target>${maven.compiler.target}</target>
                    </configuration>
                </plugin>

                <!-- Plugin para testar -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>3.1.2</version>
                </plugin>

                <!-- Plugin para gerar fontes -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>3.2.1</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

                <!-- Plugin para gerar Javadocs -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>3.5.0</version>
                    <executions>
                        <execution>
                            <id>attach-javadocs</id>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

                <!-- Plugin para gerar checksums -->
                <plugin>
                    <groupId>net.ju-n.maven.plugins</groupId>
                    <artifactId>checksum-maven-plugin</artifactId>
                    <version>1.4</version>
                    <executions>
                        <execution>
                            <phase>package</phase>
                            <goals>
                                <goal>files</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <fileSets>
                            <fileSet>
                                <directory>${project.build.directory}</directory>
                                <includes>
                                    <include>${project.build.finalName}.jar</include>
                                    <include>${project.build.finalName}-javadoc.jar</include>
                                    <include>${project.build.finalName}-sources.jar</include>
                                    <include>${project.build.finalName}.pom</include>
                                </includes>
                            </fileSet>
                        </fileSets>
                        <algorithms>
                            <algorithm>MD5</algorithm>
                            <algorithm>SHA-1</algorithm>
                        </algorithms>
                    </configuration>
                </plugin>

                <!-- Plugin para assinar os artefatos -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>3.0.1</version>
                    <executions>
                        <execution>
                            <phase>verify</phase>
                            <goals>
                                <goal>sign</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <keyname>65EF6BA2C413EE4D2551E92A97E37C964FDA6DCC</keyname>
                        <gpgArguments>
                            <arg>--batch</arg>
                        </gpgArguments>
                    </configuration>
                </plugin>

                <!-- Plugin para enviar ao Maven Central -->
                <plugin>
                    <groupId>org.sonatype.central</groupId>
                    <artifactId>central-publishing-maven-plugin</artifactId>
                    <version>0.6.0</version>
                    <extensions>true</extensions>
                    <configuration>
                        <publishingServerId>ossrh</publishingServerId>
                        <autoPublish>true</autoPublish>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <!-- Gestão de distribuição -->
    <distributionManagement>
        <repository>
            <id>central</id>
            <name>Central Repository</name>
            <url>https://central.sonatype.com/</url>
        </repository>
    </distributionManagement>


    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-release-plugin</artifactId>
                        <version>3.0.1</version>
                        <configuration>
                            <autoVersionSubmodules>true</autoVersionSubmodules>
                            <useReleaseProfile>false</useReleaseProfile>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
