<?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>flow-project</artifactId>
    <name>Flow</name>
    <packaging>pom</packaging>
    <version>2.0.2</version>

    <parent>
        <groupId>com.vaadin</groupId>
        <artifactId>vaadin-parent</artifactId>
        <version>2.0.1</version>
    </parent>

    <modules>
        <module>flow</module>
        <module>flow-server</module>
        <module>flow-push</module>
        <module>flow-data</module>
        <module>flow-osgi</module>
        <module>flow-client</module>
        <module>flow-html-components</module>
        <module>flow-html-components-testbench</module>
        <module>flow-theme-integrations</module>
        <module>flow-dnd</module>
        <module>flow-test-util</module>
        <module>flow-tests</module>
        <module>flow-server-production-mode</module>
        <module>flow-components-parent</module>
        <module>flow-maven-plugin</module>
        <module>flow-test-generic</module>
        <module>flow-bom</module>
        <module>build-tools</module>
    </modules>

    <organization>
        <name>Vaadin Ltd</name>
        <url>https://vaadin.com</url>
    </organization>
    <url>https://vaadin.com</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>
    <inceptionYear>2000</inceptionYear>
    <scm>
        <connection>scm:https:https://github.com/vaadin/flow.git</connection>
        <developerConnection>scm:git:git@github.com:vaadin/flow.git
        </developerConnection>
        <url>https://github.com/vaadin/flow</url>
    </scm>

    <properties>
        <flow.snapshot.repo.id>vaadin-snapshots</flow.snapshot.repo.id>
        <flow.snapshot.repo.url>
            https://oss.sonatype.org/content/repositories/vaadin-snapshots/
        </flow.snapshot.repo.url>
        <flow.release.repo.id>vaadin-prereleases</flow.release.repo.id>
        <flow.release.repo.url>
            https://maven.vaadin.com/vaadin-prereleases/
        </flow.release.repo.url>
        <flow.deployment.repo.id>${flow.snapshot.repo.id}</flow.deployment.repo.id>
        <flow.deployment.repo.url>
            ${flow.snapshot.repo.url}
        </flow.deployment.repo.url>
        <flow.addons.repo.id>vaadin-addons</flow.addons.repo.id>
        <flow.addons.repo.url>
            https://maven.vaadin.com/vaadin-addons
        </flow.addons.repo.url>

        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8
        </project.reporting.outputEncoding>
        <jsinterop.version>1.0.1</jsinterop.version>
        <sonar.java.source>8</sonar.java.source>
        <sonar.analysis.mode>preview</sonar.analysis.mode>
        <sonar.issuesReport.console.enable>true
        </sonar.issuesReport.console.enable>
        <sonar.issuesReport.html.enable>true</sonar.issuesReport.html.enable>
        <maven.javadoc.skip>true</maven.javadoc.skip>
        <failOnMissingWebXml>false</failOnMissingWebXml>

        <!-- Dependencies -->
        <gwt.version>2.8.2</gwt.version>
        <hibernate.validator.version>6.0.1.Final</hibernate.validator.version>
        <slf4j.version>1.7.25</slf4j.version>
        <polymer.version>2.6.1</polymer.version>

        <!-- Plugins -->
        <driver.binary.downloader.maven.plugin.version>1.0.17
        </driver.binary.downloader.maven.plugin.version>
        <frontend.maven.plugin.version>1.5</frontend.maven.plugin.version>
        <maven.surefire.plugin.version>2.22.0</maven.surefire.plugin.version>
        <maven.failsafe.plugin.version>2.22.0</maven.failsafe.plugin.version>
        <maven.war.plugin.version>3.1.0</maven.war.plugin.version>
        <maven.deploy.plugin.version>2.8.2</maven.deploy.plugin.version>
        <maven.resources.plugin.version>3.0.2</maven.resources.plugin.version>
        <maven.clean.plugin.version>3.0.0</maven.clean.plugin.version>
        <maven.exec.plugin.version>1.6.0</maven.exec.plugin.version>
        <testbench.version>6.2.0</testbench.version>
        <jetty.version>9.4.11.v20180605</jetty.version>

        <!-- Frontend -->
        <!-- Not the newest version because of https://www.polymer-project.org/2.0/docs/tools/node-support -->
        <node.version>v8.11.1</node.version>
        <npm.version>6.1.0</npm.version>

        <!-- Used in OSGi manifests -->
        <jsoup.version>1.11.3</jsoup.version>
        <!-- Note that this should be kept in sync with the class Constants -->
        <atmosphere.runtime.version>2.4.30.slf4jvaadin1</atmosphere.runtime.version>

        <!-- OSGi -->
        <!-- Note: the parserVersion value is set by build-helper-maven-plugin  -->
        <osgi.bundle.version>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}</osgi.bundle.version>
        <bnd.version>3.3.0</bnd.version>
        <osgi.core.version>6.0.0</osgi.core.version>
        <osgi.compendium.version>6.0.0</osgi.compendium.version>

        <maven.test.skip>false</maven.test.skip>
    </properties>

    <repositories>
        <!-- The order of definitions matters. Explicitly defining central here to make sure it has the highest priority. -->
        <repository>
            <id>central</id>
            <url>https://repo.maven.apache.org/maven2</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>${flow.release.repo.id}</id>
            <url>${flow.release.repo.url}</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>${flow.snapshot.repo.id}</id>
            <url>${flow.snapshot.repo.url}</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>${flow.addons.repo.id}</id>
            <url>${flow.addons.repo.url}</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
    </repositories>

    <pluginRepositories>
        <!-- The order of definitions matters. Explicitly defining central here to make sure it has the highest priority. -->
        <pluginRepository>
            <id>central</id>
            <url>https://repo.maven.apache.org/maven2</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </pluginRepository>
        <pluginRepository>
            <id>${flow.release.repo.id}</id>
            <url>${flow.release.repo.url}</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </pluginRepository>
        <pluginRepository>
            <id>${flow.snapshot.repo.id}</id>
            <url>${flow.snapshot.repo.url}</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.google.jsinterop</groupId>
                <artifactId>jsinterop</artifactId>
                <version>${jsinterop.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>com.google.gwt</groupId>
                <artifactId>gwt-elemental</artifactId>
                <version>${gwt.version}</version>
            </dependency>

            <dependency>
                <groupId>commons-io</groupId>
                <artifactId>commons-io</artifactId>
                <version>2.5</version>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-lang3</artifactId>
                <version>3.9</version>
            </dependency>

            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
            </dependency>

            <dependency>
                <groupId>javax.servlet</groupId>
                <artifactId>javax.servlet-api</artifactId>
                <version>3.1.0</version>
            </dependency>
            <dependency>
                <groupId>javax.portlet</groupId>
                <artifactId>portlet-api</artifactId>
                <version>2.0</version>
            </dependency>

            <dependency>
                <groupId>org.webjars.bowergithub.webcomponents</groupId>
                <artifactId>webcomponentsjs</artifactId>
                <version>1.2.6</version>
            </dependency>
            <dependency>
                <groupId>org.webjars.bowergithub.webcomponents</groupId>
                <artifactId>shadycss</artifactId>
                <version>1.8.0</version>
            </dependency>
            <dependency>
                <groupId>org.webjars.bowergithub.polymer</groupId>
                <artifactId>polymer</artifactId>
                <version>${polymer.version}</version>
            </dependency>

            <!-- Test dependencies -->
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-simple</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>4.12</version>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-all</artifactId>
                <version>1.10.19</version>
            </dependency>
            <dependency>
                <groupId>org.hamcrest</groupId>
                <artifactId>hamcrest-all</artifactId>
                <version>1.3</version>
            </dependency>
            <dependency>
                <groupId>org.easymock</groupId>
                <artifactId>easymock</artifactId>
                <version>3.4</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.easymock</groupId>
            <artifactId>easymock</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-all</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <extensions>
            <!-- Enabling the use of SSH for deployment -->
            <extension>
                <groupId>org.apache.maven.wagon</groupId>
                <artifactId>wagon-ssh-external</artifactId>
                <version>2.9</version>
            </extension>
        </extensions>

        <plugins>
            <plugin>
                <groupId>com.marvinformatics.formatter</groupId>
                <artifactId>formatter-maven-plugin</artifactId>
                <version>1.8.1</version>
                <configuration>
                    <configFile>classpath:/eclipse/VaadinJavaConventions.xml
                    </configFile>
                    <!-- Provide a dummy JS config file to avoid errors -->
                    <configJsFile>classpath:/eclipse/VaadinJavaConventions.xml
                    </configJsFile>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>${project.groupId}</groupId>
                        <artifactId>flow-buildtools</artifactId>
                        <version>${project.version}</version>
                    </dependency>
                </dependencies>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.0</version>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.0.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <phase>verify</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>verify</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <quiet>true</quiet>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
            </plugin>

            <plugin>
                <groupId>org.commonjava.maven.plugins</groupId>
                <artifactId>directory-maven-plugin</artifactId>
                <version>0.1</version>
                <executions>
                    <execution>
                        <id>set-root-dir-for-common-lifecycle</id>
                        <goals>
                            <goal>highest-basedir</goal>
                        </goals>
                        <phase>initialize</phase>
                        <configuration>
                            <property>project.rootdir</property>
                        </configuration>
                    </execution>
                    <execution>
                        <id>set-root-dir-for-clean-lifecycle</id>
                        <goals>
                            <goal>highest-basedir</goal>
                        </goals>
                        <phase>pre-clean</phase>
                        <configuration>
                            <property>project.rootdir</property>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-clean-plugin</artifactId>
                <version>${maven.clean.plugin.version}</version>
                <configuration>
                    <filesets>
                        <fileset>
                            <directory>${project.rootdir}/driver</directory>
                        </fileset>
                        <fileset>
                            <directory>${project.rootdir}/driver_zips
                            </directory>
                        </fileset>
                        <fileset>
                            <directory>error-screenshots</directory>
                        </fileset>
                    </filesets>
                </configuration>
            </plugin>
            <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>
            <plugin>
                <groupId>biz.aQute.bnd</groupId>
                <artifactId>bnd-maven-plugin</artifactId>
                <version>${bnd.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>bnd-process</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>1.4.1</version>
                    <dependencies>
                        <dependency>
                            <groupId>de.skuzzle.enforcer</groupId>
                            <artifactId>restrict-imports-enforcer-rule</artifactId>
                            <version>0.8.0</version>
                        </dependency>
                    </dependencies>
                    <executions>
                        <execution>
                            <id>check-logging-imports</id>
                            <phase>process-sources</phase>
                            <goals>
                                <goal>enforce</goal>
                            </goals>
                            <configuration>
                                <rules>
                                    <restrictImports
                                        implementation="de.skuzzle.enforcer.restrictimports.RestrictImports">
                                        <reason>Use SLF4j for logging</reason>
                                        <bannedImport>java.util.logging.**</bannedImport>
                                    </restrictImports>
                                </rules>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>3.0.2</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-war-plugin</artifactId>
                    <version>${maven.war.plugin.version}</version>
                    <configuration>
                        <archive>
                            <manifestEntries>
                                <Implementation-Title>${project.name}
                                </Implementation-Title>
                                <Implementation-Version>${project.version}
                                </Implementation-Version>
                            </manifestEntries>
                        </archive>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven.surefire.plugin.version}</version>
                    <configuration>
                        <trimStackTrace>false</trimStackTrace>
                        <reuseForks>false</reuseForks>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>${maven.failsafe.plugin.version}</version>
                    <configuration>
                        <trimStackTrace>false</trimStackTrace>
                        <enableAssertions>true</enableAssertions>
                        <parallel>all</parallel>
                        <threadCount>2</threadCount>
                    </configuration>
                </plugin>
                <!--This plugin's configuration is used to store Eclipse
                    m2e settings only. It has no influence on the Maven build itself. -->
                <plugin>
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>
                                            org.commonjava.maven.plugins
                                        </groupId>
                                        <artifactId>
                                            directory-maven-plugin
                                        </artifactId>
                                        <versionRange>
                                            [0.1,)
                                        </versionRange>
                                        <goals>
                                            <goal>highest-basedir</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore></ignore>
                                    </action>
                                </pluginExecution>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>
                                            org.apache.maven.plugins
                                        </groupId>
                                        <artifactId>
                                            maven-plugin-plugin
                                        </artifactId>
                                        <versionRange>
                                            [3.2,)
                                        </versionRange>
                                        <goals>
                                            <goal>descriptor</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore></ignore>
                                    </action>
                                </pluginExecution>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>
                                            org.apache.maven.plugins
                                        </groupId>
                                        <artifactId>
                                            maven-antrun-plugin
                                        </artifactId>
                                        <versionRange>
                                            [1.7,)
                                        </versionRange>
                                        <goals>
                                            <goal>run</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore></ignore>
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>license-maven-plugin</artifactId>
                    <version>1.13</version>
                    <configuration>
                        <!-- Default is system -->
                        <excludedScopes>system,test</excludedScopes>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
    <profiles>
        <profile>
            <id>validation</id>
            <properties>
                <maven.javadoc.skip>false</maven.javadoc.skip>
            </properties>
        </profile>
        <profile>
            <id>java11</id>
            <activation>
                <jdk>11</jdk>
            </activation>
            <properties>
                <maven.compiler.release>8</maven.compiler.release>
            </properties>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <artifactId>maven-surefire-plugin</artifactId>
                        </plugin>
                        <plugin>
                            <artifactId>maven-failsafe-plugin</artifactId>
                            <dependencies>
                                <dependency>
                                    <groupId>javax.xml.bind</groupId>
                                    <artifactId>jaxb-api</artifactId>
                                    <version>2.2.11</version>
                                </dependency>
                                <dependency>
                                    <groupId>com.sun.xml.bind</groupId>
                                    <artifactId>jaxb-core</artifactId>
                                    <version>2.2.11</version>
                                </dependency>
                                <dependency>
                                    <groupId>com.sun.xml.bind</groupId>
                                    <artifactId>jaxb-impl</artifactId>
                                    <version>2.2.11</version>
                                </dependency>
                                <dependency>
                                    <groupId>com.sun.activation</groupId>
                                    <artifactId>javax.activation</artifactId>
                                    <version>1.2.0</version>
                                </dependency>
                            </dependencies>
                        </plugin>
                        <plugin>
                            <groupId>com.lazerycode.selenium</groupId>
                            <artifactId>driver-binary-downloader-maven-plugin</artifactId>
                            <version>${driver.binary.downloader.maven.plugin.version}</version>
                            <dependencies>
                                <dependency>
                                    <groupId>javax.xml.bind</groupId>
                                    <artifactId>jaxb-api</artifactId>
                                    <version>2.2.11</version>
                                </dependency>
                                <dependency>
                                    <groupId>com.sun.xml.bind</groupId>
                                    <artifactId>jaxb-core</artifactId>
                                    <version>2.2.11</version>
                                </dependency>
                                <dependency>
                                    <groupId>com.sun.xml.bind</groupId>
                                    <artifactId>jaxb-impl</artifactId>
                                    <version>2.2.11</version>
                                </dependency>
                                <dependency>
                                    <groupId>com.sun.activation</groupId>
                                    <artifactId>javax.activation</artifactId>
                                    <version>1.2.0</version>
                                </dependency>
                            </dependencies>
                        </plugin>
                    </plugins>
                </pluginManagement>

            </build>
        </profile>
        <profile>
            <id>release</id>
            <modules>
                <module>flow</module>
                <module>flow-server</module>
                <module>flow-push</module>
                <module>flow-data</module>
                <module>flow-client</module>
                <module>flow-html-components</module>
                <module>flow-test-util</module>
                <module>flow-tests</module>
                <module>flow-server-production-mode</module>
                <module>flow-components-parent</module>
                <module>build-tools</module>
            </modules>
        </profile>
    </profiles>
</project>
