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

    <groupId>it.pigrecofvg</groupId>
    <artifactId>pgsenddata-starter</artifactId>
    <version>4.0.0</version>
    <name>pgsenddata-starter</name>

    <properties>
        <java.version>21</java.version>
        <springboot.version>4.1.0</springboot.version>
    </properties>

    <!--
        Niente parent: importiamo il BOM di Boot solo per allineare le versioni.
        Prima ogni starter tirava le sue e nell'albero convivevano
        spring-core 7.0.6 e spring-web 7.0.8.
    -->
    <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>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <!--
            Serve per WebClient. Da qui arriva anche spring-web (HttpHeaders,
            ResponseEntity...). Fino alla 3.0.0 c'era pure spring-boot-starter-web,
            che imponeva Tomcat e spring-webmvc a ogni consumer: nel codice non
            c'e' un solo controller ne' una sola classe servlet.
        -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-webflux</artifactId>
        </dependency>
        <dependency>
            <groupId>it.pigrecofvg</groupId>
            <artifactId>pgutils-starter</artifactId>
            <version>3.1.0</version>
        </dependency>
        <!--
            Non e' un dettaglio interno: SendDataService.send(SendData, TypeReference)
            espone Jackson nella firma pubblica e JsonUtil ne ha bisogno a runtime.
            In pgutils jackson-databind e' optional, quindi non arriva da li': finora
            funzionava solo grazie al transitivo di starter-webflux.
        -->
        <dependency>
            <groupId>tools.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
        </dependency>

        <!--
            Il driver lo fornisce l'applicazione insieme al DataSource: qui resta
            solo per build e test locali, senza propagarsi ai consumer.
        -->
        <dependency>
            <groupId>com.mysql</groupId>
            <artifactId>mysql-connector-j</artifactId>
            <scope>runtime</scope>
            <optional>true</optional>
        </dependency>
        <!-- solo annotation processing, non serve a chi usa la libreria -->
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <optional>true</optional>
        </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>
