<?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</artifactId>
    <name>Collaboration Engine</name>
    <description>Vaadin Collaboration Engine</description>
    <parent>
        <artifactId>collaboration-engine-parent</artifactId>
        <groupId>com.vaadin</groupId>
        <version>3.2.2</version>
    </parent>
    <properties>
        <!-- The parsedVersion value is set by build-helper-maven-plugin -->
        <!--suppress UnresolvedMavenProperty -->
        <osgi.bundle.version>
            ${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}
        </osgi.bundle.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>flow-server</artifactId>
            <version>${flow.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>flow-data</artifactId>
            <version>${flow.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-avatar-flow</artifactId>
            <version>${vaadin.version}</version>
            <!-- Should be updated to provided scope
                once avatar is included in V14 -->
        </dependency>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-messages-flow</artifactId>
            <version>${vaadin.version}</version>
            <!-- Should be updated to provided scope
                once messages is included in V14 -->
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.1.0</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.datatype</groupId>
            <artifactId>jackson-datatype-jsr310</artifactId>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>collaboration-engine-license-generator</artifactId>
            <version>${project.version}</version>
            <!-- Only for generating licenses in unit tests -->
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>license-checker</artifactId>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <version>3.0.2</version>
                <executions>
                    <execution>
                        <id>copy-resources</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>
                                ${project.basedir}/src/main/resources/META-INF/resources/frontend/
                            </outputDirectory>
                            <resources>
                                <resource>
                                    <directory>
                                        ${basedir}/../collaboration-engine-frontend/
                                    </directory>
                                    <filtering>true</filtering>
                                    <includes>
                                        <include>field-highlighter/src/**
                                        </include>
                                        <include>field-highlighter/theme/**
                                        </include>
                                        <include>styles/**</include>
                                    </includes>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <artifactId>maven-clean-plugin</artifactId>
                <version>3.0.0</version>
                <configuration>
                    <filesets>
                        <fileset>
                            <directory>
                                ${project.basedir}/src/main/resources/META-INF/resources/frontend/field-highlighter/
                            </directory>
                            <followSymlinks>false</followSymlinks>
                        </fileset>
                    </filesets>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.12.4</version>
                <configuration>
                    <systemPropertyVariables>
                        <!-- Used in unit test to verify that the correct version is passed to UsageStatistics -->
                        <collaboration-engine.version>${project.version}
                        </collaboration-engine.version>
                    </systemPropertyVariables>
                </configuration>
            </plugin>
            <!-- this plugin provides ${parsedVersion} that can be used for setting the correct osgi bundle version -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>3.0.0</version>
                <executions>
                    <execution>
                        <id>parse-version</id>
                        <goals>
                            <goal>parse-version</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!-- This plugin generates a /target/classes/MANIFEST.MF file based on project and /bnd.bnd -->
            <plugin>
                <groupId>biz.aQute.bnd</groupId>
                <artifactId>bnd-maven-plugin</artifactId>
                <version>5.2.0</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>bnd-process</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!-- This plugin adds /target/classes/MANIFEST.MF into the collaboration-engine.jar -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.4</version>
                <configuration>
                    <archive>
                        <manifestFile>
                            ${project.build.outputDirectory}/META-INF/MANIFEST.MF
                        </manifestFile>
                    </archive>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

