<?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>
    <!-- Project from https://start.vaadin.com/project/273ab7a5-c9d7-45ae-9ea5-2628dc716311 -->
    <groupId>be.nspire.vaadincommon</groupId>
    <artifactId>vaadin-common</artifactId>
    <name>vaadin-common</name>
    <version>4.16.0</version>
    <packaging>pom</packaging>
    <!-- major release  -->
    <properties>
        <!-- Skip deployment of parent POM - only common-lib should be deployed -->
        <maven.deploy.skip>false</maven.deploy.skip>
        <java.version>21</java.version>
        <vaadin.version>25.1.6</vaadin.version>
        <apexcharts.version>24.0.1</apexcharts.version>
        <mapstruct.version>1.5.5.Final</mapstruct.version>
        <lombok.version>1.18.30</lombok.version>
        <lombok-mapstruct-binding.version>0.2.0</lombok-mapstruct-binding.version>
        <!-- No longer managed by the Vaadin/Flow BOM as of platform 25.1; pin the version Flow 25.0 used. -->
        <commons-io.version>2.21.0</commons-io.version>
        <jacoco.version>0.8.14</jacoco.version>
    </properties>

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

    <modules>
        <module>common-lib</module>
        <module>common-lib-mysql</module>
        <module>common-lib-postgresql</module>
        <module>common-lib-h2</module>
        <module>common-app</module>
        <module>common-app-test</module>
        <module>common-empty-app</module>
        <module>common-empty-app-postgresql</module>
        <!-- Must stay last: it gates aggregated coverage after common-lib + common-lib-h2 are built. -->
        <module>common-coverage</module>
    </modules>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.vaadin</groupId>
                <artifactId>vaadin-bom</artifactId>
                <version>${vaadin.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.parttio</groupId>
                <artifactId>line-awesome</artifactId>
                <version>2.1.0</version>
            </dependency>
            <dependency>
                <groupId>nl.martijndwars</groupId>
                <artifactId>web-push</artifactId>
                <version>5.1.1</version>
            </dependency>
            <dependency>
                <groupId>org.bouncycastle</groupId>
                <artifactId>bcprov-jdk18on</artifactId>
                <version>1.78.1</version>
            </dependency>
            <dependency>
                <groupId>com.github.appreciated</groupId>
                <artifactId>apexcharts</artifactId>
                <version>${apexcharts.version}</version>
            </dependency>
            <dependency>
                <groupId>org.projectlombok</groupId>
                <artifactId>lombok</artifactId>
                <version>${lombok.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.mapstruct</groupId>
                <artifactId>mapstruct</artifactId>
                <version>${mapstruct.version}</version>
            </dependency>
            <dependency>
                <groupId>commons-io</groupId>
                <artifactId>commons-io</artifactId>
                <version>${commons-io.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <!-- version managed by spring-boot-starter-parent (currently 3.14.1) -->
                <configuration>
                    <annotationProcessorPaths>
                        <!-- Lombok FIRST -->
                        <path>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok</artifactId>
                            <version>${lombok.version}</version>
                        </path>
                        <!-- MapStruct SECOND -->
                        <path>
                            <groupId>org.mapstruct</groupId>
                            <artifactId>mapstruct-processor</artifactId>
                            <version>${mapstruct.version}</version>
                        </path>
                        <!-- Binding between them -->
                        <path>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok-mapstruct-binding</artifactId>
                            <version>${lombok-mapstruct-binding.version}</version>
                        </path>
                    </annotationProcessorPaths>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-clean-plugin</artifactId>
                <!-- version managed by spring-boot-starter-parent (currently 3.5.0) -->
                <configuration>
                    <filesets>
                        <fileset>
                            <directory>${project.basedir}/node_modules</directory>
                        </fileset>
                        <fileset>
                            <directory>${project.basedir}/src/main/frontend/generated</directory>
                        </fileset>
                    </filesets>
                </configuration>
            </plugin>
            <plugin>
                <!-- Code coverage. Inherited by every module so each produces its own
                     target/site/jacoco/jacoco.xml, which Jenkins aggregates into a coverage trend. -->
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${jacoco.version}</version>
                <configuration>
                    <!-- Exclude generated/framework-bound code that carries no meaningful test value. -->
                    <excludes>
                        <exclude>**/*Application.*</exclude>
                        <exclude>**/config/**</exclude>
                        <exclude>**/db/migration/**</exclude>
                    </excludes>
                </configuration>
                <executions>
                    <execution>
                        <id>jacoco-prepare-agent</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>jacoco-report</id>
                        <phase>test</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <extensions>
            <!-- Enabling the use of FTP -->
            <extension>
                <groupId>org.apache.maven.wagon</groupId>
                <artifactId>wagon-ftp</artifactId>
                <version>3.5.3</version>
            </extension>
        </extensions>
    </build>

    <repositories>
        <repository>
            <id>Vaadin Directory</id>
            <url>https://maven.vaadin.com/vaadin-addons</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
    </repositories>

    <distributionManagement>
        <repository>
            <id>maven.nspire.be</id>
            <name>NSPIRE Repository</name>
            <url>ftp://www.benoenenzy.be</url>
        </repository>
        <snapshotRepository>
            <id>maven.nspire.be</id>
            <name>NSPIRE Repository</name>
            <url>ftp://www.benoenenzy.be</url>
        </snapshotRepository>
    </distributionManagement>
</project>
