<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2012-2015 TORCH GmbH, 2015-2016 Graylog, Inc.
  ~
  ~ This file is part of Graylog.
  ~
  ~ Graylog is free software: you can redistribute it and/or modify
  ~ it under the terms of the GNU General Public License as published by
  ~ the Free Software Foundation, either version 3 of the License, or
  ~ (at your option) any later version.
  ~
  ~ Graylog is distributed in the hope that it will be useful,
  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  ~ GNU General Public License for more details.
  ~
  ~ You should have received a copy of the GNU General Public License
  ~ along with Graylog.  If not, see <http://www.gnu.org/licenses />.
  -->
<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>
    <prerequisites>
        <maven>3.1.0</maven>
    </prerequisites>

    <parent>
        <groupId>org.graylog.plugins</groupId>
        <artifactId>graylog-plugin-parent</artifactId>
        <version>2.2.0</version>
    </parent>

    <artifactId>graylog-plugin-web-parent</artifactId>
    <packaging>pom</packaging>

    <name>Graylog Plugin with Web support Parent POM</name>

    <profiles>
        <profile>
            <id>web-interface-build</id>
            <activation>
                <property>
                    <name>!skip.web.build</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.github.eirslett</groupId>
                        <artifactId>frontend-maven-plugin</artifactId>
                        <configuration>
                            <nodeVersion>${nodejs.version}</nodeVersion>
                            <npmVersion>${npm.version}</npmVersion>
                        </configuration>
                        <executions>
                            <execution>
                                <id>install node and npm</id>
                                <goals>
                                    <goal>install-node-and-npm</goal>
                                </goals>
                            </execution>

                            <execution>
                                <id>npm install</id>
                                <goals>
                                    <goal>npm</goal>
                                </goals>
                                <!-- Optional configuration which provides for running any npm command -->
                                <configuration>
                                    <arguments>install</arguments>
                                </configuration>
                            </execution>

                            <execution>
                                <id>npm run build</id>
                                <goals>
                                    <goal>npm</goal>
                                </goals>
                                <configuration>
                                    <arguments>run build</arguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
