<?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>1.26.0</version>
    <packaging>pom</packaging>

    <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>24.7.2</vaadin.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>
    </properties>

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

    <modules>
        <module>common-lib</module>
        <module>common-app</module>
        <module>common-app-test</module>
        <module>common-empty-app</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>nl.martijndwars</groupId>
                <artifactId>web-push</artifactId>
                <version>5.1.1</version>
            </dependency>
            <dependency>
                <groupId>org.bouncycastle</groupId>
                <artifactId>bcprov-jdk15on</artifactId>
                <version>1.69</version>
            </dependency>
            <dependency>
                <groupId>com.github.appreciated</groupId>
                <artifactId>apexcharts</artifactId>
                <version>24.0.1</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>
        </dependencies>
    </dependencyManagement>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.11.0</version>
                <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>3.1.0</version>
                <configuration>
                    <filesets>
                        <fileset>
                            <directory>${project.basedir}/node_modules</directory>
                        </fileset>
                        <fileset>
                            <directory>${project.basedir}/src/main/frontend/generated</directory>
                        </fileset>
                    </filesets>
                </configuration>
            </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>
