<?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">
    <parent>
        <artifactId>molgenis</artifactId>
        <groupId>org.molgenis</groupId>
        <version>5.2.0</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>molgenis-navigator</artifactId>
    <name>navigator</name>
    <build>
        <plugins>
            <plugin>
                <groupId>com.github.eirslett</groupId>
                <artifactId>frontend-maven-plugin</artifactId>
                <version>${frontend-maven-plugin.version}</version>
                <configuration>
                    <workingDirectory>src/main/frontend</workingDirectory>
                </configuration>
                <executions>
                    <execution>
                        <id>install node and yarn</id>
                        <goals>
                            <goal>install-node-and-yarn</goal>
                        </goals>
                        <phase>initialize</phase>
                        <configuration>
                            <nodeVersion>${node.version}</nodeVersion>
                            <yarnVersion>${yarn.version}</yarnVersion>
                        </configuration>
                    </execution>
                    <execution>
                        <id>yarn install</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>yarn</goal>
                        </goals>
                        <configuration>
                            <arguments>--frozen-lockfile</arguments>
                            <failOnError>true</failOnError>
                        </configuration>
                    </execution>
                    <execution>
                        <id>yarn build</id>
                        <goals>
                            <goal>yarn</goal>
                        </goals>
                        <phase>generate-resources</phase>
                        <configuration>
                            <arguments>run build</arguments>
                            <failOnError>true</failOnError>
                        </configuration>
                    </execution>
                    <execution>
                        <id>yarn test</id>
                        <goals>
                            <goal>yarn</goal>
                        </goals>
                        <phase>test</phase>
                        <configuration>
                            <arguments>test</arguments>
                            <failOnError>true</failOnError>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.12.4</version>
                <executions>
                    <!-- This is a hack to get Jenkins to publish Karma test results when running a
                    Maven project: we run 0 surefire tests, so Jenkins publishes the report of the Karma tests. -->
                    <execution>
                        <id>dummySureFire</id>
                        <phase>test</phase>
                        <goals>
                            <goal>test</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>org.molgenis</groupId>
            <artifactId>molgenis-core-ui</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>org.molgenis</groupId>
            <artifactId>molgenis-test</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>