<?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/maven-v4_0_0.xsd">

  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>sonia.scm</groupId>
    <artifactId>scm</artifactId>
    <version>2.0.0-SNAPSHOT</version>
  </parent>

  <groupId>sonia.scm</groupId>
  <artifactId>scm-ui</artifactId>
  <packaging>war</packaging>
  <version>2.0.0-SNAPSHOT</version>
  <name>scm-ui</name>

  <properties>
    <sonar.language>js</sonar.language>
    <sonar.sources>src</sonar.sources>
    <sonar.test.exclusions>**/*.test.js,src/tests/**</sonar.test.exclusions>
    <sonar.coverage.exclusions>**/*.test.js,src/tests/**</sonar.coverage.exclusions>
    <sonar.javascript.jstest.reportsPath>target/jest-reports</sonar.javascript.jstest.reportsPath>
    <sonar.javascript.lcov.reportPaths>target/jest-reports/coverage/lcov.info</sonar.javascript.lcov.reportPaths>
  </properties>

  <build>
    <finalName>scm-ui</finalName>
    <plugins>

      <plugin>
        <groupId>com.github.sdorra</groupId>
        <artifactId>buildfrontend-maven-plugin</artifactId>
        <configuration>
          <node>
            <version>${nodejs.version}</version>
          </node>
          <pkgManager>
            <type>YARN</type>
            <version>${yarn.version}</version>
          </pkgManager>
          <script>run</script>
        </configuration>
        <executions>
          <execution>
            <id>link-ui-types</id>
            <phase>process-sources</phase>
            <goals>
              <goal>install-link</goal>
            </goals>
            <configuration>
              <pkg>@scm-manager/ui-types</pkg>
            </configuration>
          </execution>
          <execution>
            <id>link-ui-components</id>
            <phase>process-sources</phase>
            <goals>
              <goal>install-link</goal>
            </goals>
            <configuration>
              <pkg>@scm-manager/ui-components</pkg>
            </configuration>
          </execution>
          <execution>
            <id>install</id>
            <phase>process-resources</phase>
            <goals>
              <goal>install</goal>
            </goals>
          </execution>
          <execution>
            <id>build</id>
            <phase>compile</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <script>build</script>
            </configuration>
          </execution>
          <execution>
            <id>test</id>
            <phase>test</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <script>test-ci</script>
              <skip>${skipTests}</skip>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <version>3.1.0</version>
        <configuration>
          <failOnMissingWebXml>false</failOnMissingWebXml>
          <webResources>
            <resource>
              <directory>public</directory>
            </resource>
          </webResources>
        </configuration>
      </plugin>

    </plugins>
  </build>
</project>
