<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Licensed to the Apache Software Foundation (ASF) under one or more
  ~ contributor license agreements.  See the NOTICE file distributed with
  ~ this work for additional information regarding copyright ownership.
  ~ The ASF licenses this file to You 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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <artifactId>zeppelin</artifactId>
    <groupId>org.apache.zeppelin</groupId>
    <version>0.6.2</version>
    <relativePath>..</relativePath>
  </parent>

  <groupId>org.apache.zeppelin</groupId>
  <artifactId>zeppelin-web</artifactId>
  <packaging>war</packaging>
  <version>0.6.2</version>
  <name>Zeppelin: web Application</name>

  <!-- See https://github.com/eirslett/frontend-maven-plugin/issues/229 -->
  <prerequisites>
    <maven>3.1.0</maven>
  </prerequisites>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <configuration>
          <warSourceDirectory>dist</warSourceDirectory>
          <webXml>dist\WEB-INF\web.xml</webXml>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.rat</groupId>
        <artifactId>apache-rat-plugin</artifactId>
        <configuration>
          <excludes>
            <exclude>**/.idea/</exclude>
            <exclude>**/*.iml</exclude>
            <exclude>.git/</exclude>
            <exclude>.gitignore</exclude>
            <exclude>.bowerrc</exclude>
            <exclude>.editorconfig</exclude>
            <exclude>.jshintrc</exclude>
            <exclude>.tmp/**</exclude>
            <exclude>**/.settings/*</exclude>
            <exclude>**/.classpath</exclude>
            <exclude>**/.project</exclude>
            <exclude>**/target/**</exclude>
            <exclude>node/**</exclude>
            <exclude>node_modules/**</exclude>
            <exclude>bower_components/**</exclude>
            <exclude>test/**</exclude>
            <exclude>dist/**</exclude>
            <exclude>src/.buildignore</exclude>
            <exclude>src/fonts/fontawesome*</exclude>
            <exclude>src/fonts/font-awesome*</exclude>
            <exclude>src/styles/font-awesome*</exclude>
            <exclude>src/fonts/Simple-Line*</exclude>
            <exclude>src/fonts/simple-line*</exclude>
            <exclude>src/fonts/Patua-One*</exclude>
            <exclude>src/fonts/Roboto*</exclude>
            <exclude>src/fonts/Source-Code-Pro*</exclude>
            <exclude>bower.json</exclude>
            <exclude>package.json</exclude>
            <exclude>*.md</exclude>
          </excludes>
        </configuration>
      </plugin>

      <plugin>
        <groupId>com.github.eirslett</groupId>
        <artifactId>frontend-maven-plugin</artifactId>
        <version>0.0.25</version>
        <executions>

          <execution>
            <id>install node and npm</id>
            <goals>
              <goal>install-node-and-npm</goal>
            </goals>
            <configuration>
              <nodeVersion>v0.12.13</nodeVersion>
              <npmVersion>2.15.0</npmVersion>
            </configuration>
          </execution>

          <execution>
            <id>npm install</id>
            <goals>
              <goal>npm</goal>
            </goals>
          </execution>

          <execution>
            <id>bower install</id>
            <goals>
              <goal>bower</goal>
            </goals>
            <configuration>
              <arguments>--allow-root install</arguments>
            </configuration>
          </execution>

          <execution>
            <id>grunt build</id>
            <goals>
              <goal>grunt</goal>
            </goals>
            <configuration>
              <arguments>build</arguments>
            </configuration>
          </execution>

          <execution>
            <id>grunt test</id>
            <goals>
              <goal>grunt</goal>
            </goals>
            <phase>test</phase>
            <configuration>
              <arguments>test</arguments>
            </configuration>
          </execution>

        </executions>
      </plugin>

      <!--
          Disabling test report generation as it forks the lifecycle
          and results in https://issues.apache.org/jira/browse/ZEPPELIN-69

          There is no better way to do it, as per
          http://jira.codehaus.org/browse/MCOBERTURA-154
      -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>cobertura-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>cobertura</id>
            <phase>none</phase>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-deploy-plugin</artifactId>
        <version>2.7</version>
      </plugin>

      <plugin>
        <artifactId>maven-clean-plugin</artifactId>
        <configuration>
          <filesets>
            <fileset>
              <directory>bower_components</directory>
            </fileset>
          </filesets>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

</project>
