<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>4.1.0</version>
        <relativePath/>
    </parent>

    <groupId>it.pigrecofvg</groupId>
    <artifactId>pgsessioncheck-starter</artifactId>
    <version>1.0.0</version>
    <name>pgsessioncheck-starter</name>
    <description>Starter Spring Boot: endpoint di controllo sessione + script Pebble di polling con redirect al contextpath</description>

    <properties>
        <java.version>21</java.version>
        <pebble.version>4.1.2</pebble.version>
        <pgauth.version>2.0.5</pgauth.version>
    </properties>

    <dependencies>
        <!-- Autoconfigurazione + condition annotations -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-autoconfigure</artifactId>
        </dependency>

        <!-- Web MVC (controller REST + HttpServletRequest). Le app consumatrici sono webapp,
             quindi optional: non forziamo lo stack web e i bean sono gated da @ConditionalOnWebApplication. -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <optional>true</optional>
        </dependency>

        <!-- Pebble: serve solo per registrare l'Extension con le variabili globali.
             Optional + bean gated da @ConditionalOnClass(Extension). -->
        <dependency>
            <groupId>io.pebbletemplates</groupId>
            <artifactId>pebble</artifactId>
            <version>${pebble.version}</version>
            <optional>true</optional>
        </dependency>

        <!-- pgauth: abilita il validator di default basato sulla sessione pgauth.
             Optional: senza pgauth si usa il validator generico. -->
        <dependency>
            <groupId>it.pigrecofvg.pgauth</groupId>
            <artifactId>pgauth-starter</artifactId>
            <version>${pgauth.version}</version>
            <optional>true</optional>
        </dependency>

        <!-- Metadata per le proprietà pgsession.* (autocompletamento IDE) -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-configuration-processor</artifactId>
            <optional>true</optional>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <!-- Libreria, non applicazione: niente repackage dello spring-boot-maven-plugin. -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

    <repositories>
        <repository>
            <id>pigreco</id>
            <url>https://forgejo.pigrecofvg.it/api/packages/pigreco/maven</url>
        </repository>
    </repositories>
    <distributionManagement>
        <repository>
            <id>pigreco</id>
            <url>https://forgejo.pigrecofvg.it/api/packages/pigreco/maven</url>
        </repository>
        <snapshotRepository>
            <id>pigreco</id>
            <url>https://forgejo.pigrecofvg.it/api/packages/pigreco/maven</url>
        </snapshotRepository>
    </distributionManagement>

</project>
