<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright © 2013 Sven Ruppert (sven.ruppert@gmail.com)

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<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">
  <parent>
    <groupId>org.rapidpm</groupId>
    <artifactId>rapidpm-vaadin-dependencies</artifactId>
    <version>04.03.01-RPM</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <packaging>pom</packaging>
  <artifactId>rapidpm-vaadin-dependencies-v14</artifactId>


  <properties>
    <vaadin-productionMode>false</vaadin-productionMode>
    <vaadin-install-nodejs>false</vaadin-install-nodejs>
    <frontend-maven-plugin.nodeVersion>v10.16.0</frontend-maven-plugin.nodeVersion>
    <frontend-maven-plugin.npmVersion>6.9.0</frontend-maven-plugin.npmVersion>
    <!--    <frontend-maven-plugin.installDirectory>target</frontend-maven-plugin.installDirectory>-->
  </properties>

  <pluginRepositories>
    <pluginRepository>
      <id>Vaadin - Prereleases</id>
      <url>https://maven.vaadin.com/vaadin-prereleases</url>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </pluginRepository>
  </pluginRepositories>

  <repositories>
    <repository>
      <id>Vaadin Directory</id>
      <url>http://maven.vaadin.com/vaadin-addons</url>
    </repository>
    <!-- Repository needed for prerelease versions of Vaadin -->
    <repository>
      <id>Vaadin - Prereleases</id>
      <url>https://maven.vaadin.com/vaadin-prereleases</url>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
  </repositories>


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

      <dependency>
        <groupId>com.vaadin</groupId>
        <artifactId>vaadin-testbench</artifactId>
        <version>${vaadin-v14.version}</version>
        <exclusions>
          <exclusion>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-server</artifactId>
          </exclusion>
          <exclusion>
            <groupId>com.vaadin</groupId>
            <artifactId>license-checker</artifactId>
          </exclusion>
        </exclusions>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>com.vaadin</groupId>
        <artifactId>vaadin-testbench-core</artifactId>
        <version>${vaadin-testbench-v14.version}</version>
        <exclusions>
          <exclusion>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-server</artifactId>
          </exclusion>
          <exclusion>
            <groupId>com.vaadin</groupId>
            <artifactId>license-checker</artifactId>
          </exclusion>
        </exclusions>
        <scope>test</scope>
      </dependency>

    </dependencies>
  </dependencyManagement>

  <dependencies>
    <dependency>
      <groupId>org.rapidpm</groupId>
      <artifactId>rapidpm-vaadin-flow-commons</artifactId>
    </dependency>
    <dependency>
      <groupId>com.vaadin</groupId>
      <artifactId>flow-server</artifactId>
    </dependency>
    <dependency>
      <groupId>com.vaadin</groupId>
      <artifactId>flow-push</artifactId>
    </dependency>
    <dependency>
      <groupId>com.vaadin</groupId>
      <artifactId>flow-client</artifactId>
    </dependency>
    <dependency>
      <groupId>com.vaadin</groupId>
      <artifactId>flow-html-components</artifactId>
    </dependency>
    <dependency>
      <groupId>com.vaadin</groupId>
      <artifactId>flow-data</artifactId>
    </dependency>
    <!--Vaadin -->
    <!--    <dependency>-->
    <!--      <groupId>com.vaadin</groupId>-->
    <!--      &lt;!&ndash; Replace artifactId with vaadin-core to use only free components &ndash;&gt;-->
    <!--      <artifactId>vaadin-core</artifactId>-->
    <!--      <exclusions>-->
    <!--        &lt;!&ndash; Webjars are only needed when running in Vaadin 13 compatibility mode &ndash;&gt;-->
    <!--        <exclusion>-->
    <!--          <groupId>com.vaadin.webjar</groupId>-->
    <!--          <artifactId>*</artifactId>-->
    <!--        </exclusion>-->
    <!--        <exclusion>-->
    <!--          <groupId>org.webjars.bowergithub.insites</groupId>-->
    <!--          <artifactId>*</artifactId>-->
    <!--        </exclusion>-->
    <!--        <exclusion>-->
    <!--          <groupId>org.webjars.bowergithub.polymer</groupId>-->
    <!--          <artifactId>*</artifactId>-->
    <!--        </exclusion>-->
    <!--        <exclusion>-->
    <!--          <groupId>org.webjars.bowergithub.polymerelements</groupId>-->
    <!--          <artifactId>*</artifactId>-->
    <!--        </exclusion>-->
    <!--        <exclusion>-->
    <!--          <groupId>org.webjars.bowergithub.vaadin</groupId>-->
    <!--          <artifactId>*</artifactId>-->
    <!--        </exclusion>-->
    <!--        <exclusion>-->
    <!--          <groupId>org.webjars.bowergithub.webcomponents</groupId>-->
    <!--          <artifactId>*</artifactId>-->
    <!--        </exclusion>-->
    <!--      </exclusions>-->
    <!--    </dependency>-->
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>com.vaadin</groupId>
        <artifactId>vaadin-maven-plugin</artifactId>
        <version>${vaadin-v14.version}</version>
        <executions>
          <execution>
            <phase>test-compile</phase>
            <goals>
              <goal>prepare-frontend</goal>
              <goal>build-frontend</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>vaadin-install-nodejs</id>
      <activation>
        <!--        <activeByDefault>false</activeByDefault>-->
        <property>
          <name>vaadin-install-nodejs</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>com.github.eirslett</groupId>
            <artifactId>frontend-maven-plugin</artifactId>
            <executions>
              <execution>
                <!-- optional: you don't really need execution ids, but it looks nice in your build log. -->
                <id>install node and npm</id>
                <goals>
                  <goal>install-node-and-npm</goal>
                </goals>
                <!-- optional: default phase is "generate-resources" -->
                <phase>generate-resources</phase>
              </execution>
            </executions>
            <configuration>
              <nodeVersion>${frontend-maven-plugin.nodeVersion}</nodeVersion>
              <!-- optional: with node version greater than 4.0.0 will use npm provided by node distribution -->
              <npmVersion>${frontend-maven-plugin.npmVersion}</npmVersion>
              <!-- optional: where to download node and npm from. Defaults to https://nodejs.org/dist/ -->
              <!--              <downloadRoot>http://myproxy.example.org/nodejs/</downloadRoot>-->
              <installDirectory>${frontend-maven-plugin.installDirectory}</installDirectory>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>vaadin-productionMode</id>
      <activation>
        <activeByDefault>false</activeByDefault>
        <property>
          <name>vaadin-productionMode</name>
        </property>
      </activation>
      <dependencies>
        <dependency>
          <groupId>com.vaadin</groupId>
          <artifactId>flow-server-production-mode</artifactId>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-maven-plugin</artifactId>
            <version>${vaadin-v14.version}</version>
            <executions>
              <execution>
                <goals>
                  <goal>copy-production-files</goal>
                  <goal>package-for-production</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>


</project>