<?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>it.pigrecofvg.pebble</groupId>
    <artifactId>pebble-extensions-starter</artifactId>
    <version>3.0.0</version>

    <properties>
        <maven.compiler.source>21</maven.compiler.source>
        <maven.compiler.target>21</maven.compiler.target>
        <springboot.version>4.1.0</springboot.version>
        <pebble.version>4.1.2</pebble.version>
    </properties>

    <!--
        Niente parent: importiamo il BOM di Boot solo per allineare le versioni.
        Prima spring-core e spring-web finivano su release diverse (7.0.6 / 7.0.8)
        perche' ogni starter le tirava per conto suo.
    -->
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>${springboot.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <!--
            Libreria di filtri/funzioni Pebble: dipende dal minimo indispensabile.
            Fino alla 2.0.5 c'erano spring-boot-starter e spring-boot-starter-web,
            che trascinavano Tomcat, spring-webmvc, Logback e snakeyaml in ogni
            consumer. Nel codice non c'e' una sola classe di spring-webmvc.
        -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
        </dependency>

        <!-- @AutoConfiguration e @ConditionalOn* di DefaultAutoConfiguration -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-autoconfigure</artifactId>
        </dependency>

        <!-- RequestContextHolder / ServletRequestAttributes in ActiveFunction e HrefidFunction -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
        </dependency>

        <!-- HttpServletRequest: lo fornisce il container del consumer -->
        <dependency>
            <groupId>jakarta.servlet</groupId>
            <artifactId>jakarta.servlet-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- solo per JsonFilter. Prima arrivava di rimbalzo da spring-boot-starter-web -->
        <dependency>
            <groupId>tools.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
        </dependency>

        <!-- le classi Filter/Function che questa libreria implementa -->
        <dependency>
            <groupId>io.pebbletemplates</groupId>
            <artifactId>pebble</artifactId>
            <version>${pebble.version}</version>
        </dependency>

        <!--
            Serve a runtime: e' l'autoconfigurazione che espone il bean PebbleEngine
            iniettato in TemplateUtil. dependency:analyze lo segnala come inutilizzato
            perche' non vede le dipendenze risolte per iniezione: non rimuoverlo.
        -->
        <dependency>
            <groupId>io.pebbletemplates</groupId>
            <artifactId>pebble-spring-boot-starter</artifactId>
            <version>${pebble.version}</version>
        </dependency>

        <dependency>
            <groupId>commons-validator</groupId>
            <artifactId>commons-validator</artifactId>
            <version>1.11.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
        </dependency>
    </dependencies>

    <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>
