<?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>mpr-project</artifactId>
    <name>MPR Project</name>
    <packaging>pom</packaging>
    <version>7.0.7</version>

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

    <modules>
        <module>mpr-core</module>
        <module>mpr-v7</module>
        <module>mpr-v8</module>
    </modules>

    <organization>
        <name>Vaadin Ltd</name>
        <url>http://vaadin.com</url>
    </organization>
    <url>http://vaadin.com</url>
    <licenses>
        <license>
            <name>Vaadin Commercial License and Service Terms</name>
            <url>https://vaadin.com/commercial-license-and-service-terms</url>
        </license>
    </licenses>
    <scm>
        <connection>
            scm:https:https://github.com/vaadin/multiplatform-runtime-internal.git
        </connection>
        <developerConnection>
            scm:git:git@github.com:vaadin/multiplatform-runtime-internal.git
        </developerConnection>
        <url>https://github.com/vaadin/multiplatform-runtime-internal</url>
    </scm>

    <properties>
        <mpr.prerelease.repo.id>vaadin-prereleases</mpr.prerelease.repo.id>
        <mpr.prerelease.repo.url>
            https://maven.vaadin.com/vaadin-prereleases/
        </mpr.prerelease.repo.url>
        <mpr.addons.repo.id>vaadin-addons</mpr.addons.repo.id>
        <mpr.addons.repo.url>
            https://maven.vaadin.com/vaadin-addons/
        </mpr.addons.repo.url>

        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>11</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>7.0.2.Final</hibernate.validator.version>
        <slf4j.version>2.0.3</slf4j.version>

        <framework.7.version>7.7.38</framework.7.version>
        <framework.7.plugin.version>${framework.7.version}
        </framework.7.plugin.version>

        <framework.8.version>8.20.0</framework.8.version>
        <framework.8.plugin.version>${framework.8.version}
        </framework.8.plugin.version>

        <framework.version>${framework.8.version}</framework.version>
        <flow.version>24.1.7</flow.version>

        <flow.cdi.version>15.0.0</flow.cdi.version>

        <!-- Plugins -->
        <driver.binary.downloader.maven.plugin.version>1.0.14
        </driver.binary.downloader.maven.plugin.version>
        <frontend.maven.plugin.version>1.5</frontend.maven.plugin.version>
        <maven.surefire.plugin.version>2.20</maven.surefire.plugin.version>
        <maven.failsafe.plugin.version>3.0.0-M7</maven.failsafe.plugin.version>
        <maven.war.plugin.version>3.3.2</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>
        <jetty.version>11.0.12</jetty.version>
        <mockito.version>4.8.0</mockito.version>
        <spring.version>3.0.6</spring.version>

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

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

        <!-- 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>5.3.0</bnd.version>
        <currentYear>2022</currentYear>
    </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>${mpr.prerelease.repo.id}</id>
            <url>${mpr.prerelease.repo.url}</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>${mpr.addons.repo.id}</id>
            <url>${mpr.addons.repo.url}</url>
        </repository>
        <repository>
            <id>spring milestones</id>
            <url>https://repo.spring.io/milestone</url>
        </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>${mpr.prerelease.repo.id}</id>
            <url>${mpr.prerelease.repo.url}</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </pluginRepository>
        <pluginRepository>
            <id>spring milestones</id>
            <url>https://repo.spring.io/milestone</url>
        </pluginRepository>
    </pluginRepositories>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.vaadin</groupId>
                <artifactId>flow-bom</artifactId>
                <version>${flow.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <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.6</version>
            </dependency>

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

            <dependency>
                <groupId>jakarta.servlet</groupId>
                <artifactId>jakarta.servlet-api</artifactId>
                <version>5.0.0</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.13.2</version>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>${mockito.version}</version>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-inline</artifactId>
                <version>${mockito.version}</version>
            </dependency>
            <dependency>
                <groupId>org.hamcrest</groupId>
                <artifactId>hamcrest-all</artifactId>
                <version>1.3</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-all</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>net.jcip</groupId>
            <artifactId>jcip-annotations</artifactId>
            <version>1.0</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>3.2.0</version>
                <executions>
                    <execution>
                        <id>parse-version</id>
                        <goals>
                            <goal>parse-version</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.7.0</version>
            </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>
        </plugins>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>3.2.1</version>
                    <executions>
                        <execution>
                            <id>attach-sources</id>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                            <configuration>
                                <includes>com/vaadin/mpr/client/**</includes>
                            </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-javadoc-plugin</artifactId>
                    <version>3.3.1</version>
                    <executions>
                        <execution>
                            <id>attach-javadocs</id>
                            <phase>package</phase>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <quiet>true</quiet>
                    </configuration>
                </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-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>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>com.mycila</groupId>
                    <artifactId>license-maven-plugin</artifactId>
                    <version>3.0</version>
                    <inherited>false</inherited>
                    <configuration>
                        <header>${basedir}/src/license/vclst/header.txt</header>
                        <quiet>false</quiet>
                        <failIfMissing>true</failIfMissing>
                        <aggregate>true</aggregate>
                        <useDefaultExcludes>true</useDefaultExcludes>
                        <useDefaultMapping>true</useDefaultMapping>
                        <encoding>UTF-8</encoding>
                        <properties>
                            <year>${currentYear}</year>
                        </properties>
                        <excludes>
                            <exclude>**/target/**</exclude>
                            <exclude>**/*.xml</exclude>
                            <exclude>src/license/**/*</exclude>
                            <exclude>**/*.txt</exclude>
                            <exclude>**/*.properties</exclude>
                            <exclude>**/*.ts</exclude>
                            <exclude>**/node_modules/**</exclude>
                            <exclude>**/pnpm-lock.yaml</exclude>
                            <exclude>**/webpack.generated.js</exclude>
                            <exclude>**/webpack.config.js</exclude>
                            <exclude>**/pnpmfile.js</exclude>
                            <!-- Exclude the checks for test and doc modules -->
                            <!-- which are not inherited from parent pom -->
                            <exclude>mpr-tests/**</exclude>
                            <exclude>mpr-documentation/**</exclude>
                            <exclude>**/ResizeObserver-*.min.js</exclude>
                            <exclude>scripts/**</exclude>
                        </excludes>

                    </configuration>
                    <executions>
                        <execution>
                            <goals>
                                <goal>check</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <profiles>
        <!-- Tests and documentation are skipped if -DskipTests is set -->
        <profile>
            <id>fullBuild</id>
            <activation>
                <property>
                    <name>!skipTests</name>
                </property>
            </activation>

            <modules>
                <module>mpr-tests</module>
            </modules>
        </profile>
        <profile>
            <id>license-check</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.mycila</groupId>
                        <artifactId>license-maven-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
