<?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>
    <artifactId>collaboration-engine-parent</artifactId>
    <version>6.6-SNAPSHOT</version>
    <name>Collaboration Engine Parent</name>
    <packaging>pom</packaging>

    <parent>
        <groupId>com.vaadin</groupId>
        <artifactId>vaadin-parent</artifactId>
        <version>3.0.0</version>
    </parent>
    <url>https://vaadin.com/collaboration</url>
    <licenses>
        <license>
            <name>Apache License Version 2.0</name>
            <distribution>repo</distribution>
            <url>http://www.apache.org/licenses/LICENSE-2.0</url>
        </license>
    </licenses>

    <modules>
        <!-- Only the modules that should be included in releases should be
            here. Others should be listed down in the default profile. -->
        <module>collaboration-engine</module>
    </modules>

    <properties>
        <maven.compiler.source>17</maven.compiler.source>
        <maven.compiler.target>17</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

        <!-- Versions to keep in sync with the targeted platform version: -->
        <!-- spring,cdi versions has been moved to test module. -->
        <flow.version>24.9-SNAPSHOT</flow.version>
        <vaadin.component.version>24.9-SNAPSHOT</vaadin.component.version>
        <vaadin.lumo.version>${vaadin.component.version}</vaadin.lumo.version>

        <!-- Keep in sync with flow-server: -->
        <jackson.version>2.19.1</jackson.version>
        <junit.version>4.13.2</junit.version>
        <jetty.version>11.0.25</jetty.version>

        <!-- plugin versions -->
        <spotless.plugin.version>2.43.0</spotless.plugin.version>
        <spotless.licence-header>${maven.multiModuleProjectDirectory}/scripts/apache2-license-header.txt</spotless.licence-header>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${junit.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson</groupId>
                <artifactId>jackson-bom</artifactId>
                <type>pom</type>
                <scope>import</scope>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.vaadin</groupId>
                <artifactId>license-checker</artifactId>
                <version>2.0.0</version>
            </dependency>
            <dependency>
                <groupId>com.vaadin</groupId>
                <artifactId>vaadin-avatar-flow</artifactId>
                <version>${vaadin.component.version}</version>
            </dependency>
            <dependency>
                <groupId>com.vaadin</groupId>
                <artifactId>vaadin-field-highlighter-flow</artifactId>
                <version>${vaadin.component.version}</version>
            </dependency>
            <dependency>
                <groupId>com.vaadin</groupId>
                <artifactId>vaadin-messages-flow</artifactId>
                <version>${vaadin.component.version}</version>
            </dependency>
            <dependency>
                <groupId>com.vaadin</groupId>
                <artifactId>vaadin-lumo-theme</artifactId>
                <version>${vaadin.lumo.version}</version>
            </dependency>
            <dependency>
                <groupId>com.vaadin</groupId>
                <artifactId>vaadin-button-flow</artifactId>
                <version>${vaadin.component.version}</version>
            </dependency>
            <dependency>
                <groupId>com.vaadin</groupId>
                <artifactId>vaadin-notification-flow</artifactId>
                <version>${vaadin.component.version}</version>
            </dependency>
            <dependency>
                <groupId>com.vaadin</groupId>
                <artifactId>vaadin-ordered-layout-flow</artifactId>
                <version>${vaadin.component.version}</version>
            </dependency>
            <dependency>
                <groupId>com.vaadin</groupId>
                <artifactId>vaadin-text-field-flow</artifactId>
                <version>${vaadin.component.version}</version>
            </dependency>

            <dependency>
                <groupId>com.vaadin</groupId>
                <artifactId>vaadin-avatar-testbench</artifactId>
                <scope>test</scope>
                <version>${vaadin.component.version}</version>
            </dependency>
            <dependency>
                <groupId>com.vaadin</groupId>
                <artifactId>vaadin-messages-testbench</artifactId>
                <version>${vaadin.component.version}</version>
            </dependency>
            <dependency>
                <groupId>com.vaadin</groupId>
                <artifactId>vaadin-text-field-testbench</artifactId>
                <version>${vaadin.component.version}</version>
            </dependency>
            <dependency>
                <groupId>com.vaadin</groupId>
                <artifactId>vaadin-checkbox-testbench</artifactId>
                <version>${vaadin.component.version}</version>
            </dependency>
            <dependency>
                <groupId>com.vaadin</groupId>
                <artifactId>vaadin-radio-button-testbench</artifactId>
                <version>${vaadin.component.version}</version>
            </dependency>
            <dependency>
                <groupId>com.vaadin</groupId>
                <artifactId>vaadin-dialog-testbench</artifactId>
                <version>${vaadin.component.version}</version>
            </dependency>
            <dependency>
                <groupId>com.vaadin</groupId>
                <artifactId>vaadin-button-testbench</artifactId>
                <version>${vaadin.component.version}</version>
            </dependency>
            <dependency>
                <groupId>com.vaadin</groupId>
                <artifactId>vaadin-dialog-flow</artifactId>
                <version>${vaadin.component.version}</version>
            </dependency>
            <dependency>
                <groupId>com.vaadin</groupId>
                <artifactId>vaadin-checkbox-flow</artifactId>
                <version>${vaadin.component.version}</version>
            </dependency>
            <dependency>
                <groupId>com.vaadin</groupId>
                <artifactId>vaadin-radio-button-flow</artifactId>
                <version>${vaadin.component.version}</version>
            </dependency>

        </dependencies>
    </dependencyManagement>

    <repositories>
        <repository>
            <id>central</id>
            <url>https://repo.maven.apache.org/maven2</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>vaadin-prereleases</id>
            <url>https://maven.vaadin.com/vaadin-prereleases</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>central</id>
            <url>https://repo.maven.apache.org/maven2</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </pluginRepository>
        <pluginRepository>
            <id>vaadin-prereleases</id>
            <url>https://maven.vaadin.com/vaadin-prereleases</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>

    <distributionManagement>
        <repository>
            <id>vaadin-prereleases</id>
            <url>https://maven.vaadin.com/vaadin-prereleases/</url>
        </repository>
    </distributionManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-war-plugin</artifactId>
                    <version>3.3.1</version>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.0.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <phase>package</phase>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.0.1</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <phase>package</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <quiet>true</quiet>
                    <doclint>none</doclint>
                </configuration>
            </plugin>

            <plugin>
                <groupId>com.diffplug.spotless</groupId>
                <artifactId>spotless-maven-plugin</artifactId>
                <version>${spotless.plugin.version}</version>
                <configuration>
                    <java>
                        <eclipse>
                            <file>https://raw.githubusercontent.com/vaadin/flow/main/eclipse/VaadinJavaConventions.xml</file>
                        </eclipse>
                        <endWithNewline/>
                        <removeUnusedImports />
                        <importOrder>
                            <wildcardsLast>true</wildcardsLast>
                            <order>java|javax,org,com</order>
                        </importOrder>
                        <licenseHeader>
                            <file>${spotless.licence-header}</file>
                        </licenseHeader>
                    </java>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>default</id>
            <activation>
                <property>
                    <name>!release</name>
                </property>
            </activation>
            <modules>
                <module>collaboration-engine-demo</module>
                <module>collaboration-engine-test</module>
            </modules>
        </profile>
    </profiles>

</project>
