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

 Copyright (C) 2015 eXo Platform SAS.

 This is free software; you can redistribute it and/or modify it
 under the terms of the GNU Lesser General Public License as
 published by the Free Software Foundation; either version 2.1 of
 the License, or (at your option) any later version.

 This software 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
 Lesser General Public License for more details.

 You should have received a copy of the GNU Lesser General Public
 License along with this software; if not, write to the Free
 Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 02110-1301 USA, or see the FSF site: http://www.fsf.org.

-->
<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>
  <parent>
    <artifactId>task-management-parent</artifactId>
    <groupId>org.exoplatform.addons.task</groupId>
    <version>3.1.1</version>
  </parent>
  <artifactId>task-management</artifactId>
  <packaging>war</packaging>
  <name>eXo Add-on:: Task Management Application</name>
  <properties>
    <!-- Maven Plugin for JS and CSS bundling and Unit Test execution -->
    <com.github.eirslett.frontend.version>1.6</com.github.eirslett.frontend.version>
    <node.version>v11.4.0</node.version>
    <npm.version>6.5.0</npm.version>
    <exo.test.coverage.ratio>0.01</exo.test.coverage.ratio>
  </properties>
  <dependencies>
    <dependency>
      <groupId>org.exoplatform.addons.task</groupId>
      <artifactId>task-management-services</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.exoplatform.platform-ui</groupId>
      <artifactId>platform-ui-skin</artifactId>
      <classifier>sources</classifier>
      <scope>provided</scope>
    </dependency>
    <!-- Juzu -->
    <dependency>
      <groupId>org.juzu</groupId>
      <artifactId>juzu-core</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.juzu</groupId>
      <artifactId>juzu-plugins-less4j</artifactId>
      <exclusions>
        <exclusion>
          <artifactId>commons-io</artifactId>
          <groupId>commons-io</groupId>
        </exclusion>
        <exclusion>
          <artifactId>commons-beanutils</artifactId>
          <groupId>commons-beanutils</groupId>
        </exclusion>
        <exclusion>
          <artifactId>json</artifactId>
          <groupId>org.json</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.juzu</groupId>
      <artifactId>juzu-plugins-webjars</artifactId>
    </dependency>
    <dependency>
      <groupId>javax.portlet</groupId>
      <artifactId>portlet-api</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.juzu</groupId>
      <artifactId>juzu-plugins-portlet</artifactId>
      <scope>provided</scope>
    </dependency>
    <!-- JS libraries -->
    <dependency>
      <groupId>org.webjars</groupId>
      <artifactId>x-editable-bootstrap</artifactId>
    </dependency>
    <dependency>
      <groupId>org.webjars</groupId>
      <artifactId>bootstrap-datepicker</artifactId>
    </dependency>
    <dependency>
      <groupId>org.webjars</groupId>
      <artifactId>selectize.js</artifactId>
    </dependency>
    <dependency>
      <groupId>org.webjars</groupId>
      <artifactId>select2</artifactId>
    </dependency>
    <dependency>
      <groupId>org.webjars</groupId>
      <artifactId>jquery-ui</artifactId>
    </dependency>
    <dependency>
      <groupId>org.exoplatform.core</groupId>
      <artifactId>exo.core.component.organization.api</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.exoplatform.commons</groupId>
      <artifactId>commons-api</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.exoplatform.commons</groupId>
      <artifactId>commons-juzu</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.exoplatform.gatein.portal</groupId>
      <artifactId>exo.portal.webui.portal</artifactId>
      <scope>provided</scope>
    </dependency>
    <!-- Groovy is shipped with GateIn -->
    <dependency>
      <groupId>org.codehaus.groovy</groupId>
      <artifactId>groovy-all</artifactId>
      <scope>provided</scope>
    </dependency>
    <!-- Dependencies for Guice in GateIn portal -->
    <dependency>
      <groupId>javax.inject</groupId>
      <artifactId>javax.inject</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.google.inject</groupId>
      <artifactId>guice</artifactId>
      <scope>provided</scope>
    </dependency>
    <!-- Junit for testing -->
    <dependency>
      <groupId>org.juzu</groupId>
      <artifactId>juzu-core</artifactId>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.juzu</groupId>
      <artifactId>juzu-depchain-arquillian</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.juzu</groupId>
      <artifactId>juzu-depchain-arquillian-tomcat7</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.exoplatform.commons</groupId>
      <artifactId>commons-component-common</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.exoplatform.social</groupId>
      <artifactId>social-component-core</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <build>
    <finalName>task-management</finalName>
    <plugins>
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <executions>
          <execution>
            <id>less-copy-resources</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.directory}/src/main/webapp/skin/less</outputDirectory>
              <resources>
                <resource>
                  <directory>src/main/webapp/skin/css</directory>
                </resource>
              </resources>
              <overwrite>true</overwrite>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>platform-ui-src</id>
            <phase>initialize</phase>
            <goals>
              <goal>unpack-dependencies</goal>
            </goals>
            <configuration>
              <includeArtifactIds>platform-ui-skin</includeArtifactIds>
              <outputDirectory>${project.build.directory}/src/main/webapp</outputDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.lesscss</groupId>
        <artifactId>lesscss-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>core</id>
            <configuration>
              <sourceDirectory>${project.build.directory}/src/main/webapp/skin/less</sourceDirectory>
              <outputDirectory>${project.build.directory}/${project.build.finalName}/skin/css</outputDirectory>
              <compress>false</compress>
              <includes>
                <include>tasks.less</include>
              </includes>
            </configuration>
            <goals>
              <goal>compile</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>com.github.eirslett</groupId>
        <artifactId>frontend-maven-plugin</artifactId>
        <version>${com.github.eirslett.frontend.version}</version>
        <configuration>
          <installDirectory>target</installDirectory>
        </configuration>
        <executions>
          <execution>
            <id>install node and npm</id>
            <phase>compile</phase>
            <goals>
              <goal>install-node-and-npm</goal>
            </goals>
            <configuration>
              <nodeVersion>${node.version}</nodeVersion>
              <npmVersion>${npm.version}</npmVersion>
            </configuration>
          </execution>
          <execution>
            <id>npm install</id>
            <phase>compile</phase>
            <goals>
              <goal>npm</goal>
            </goals>
            <configuration>
              <arguments>install</arguments>
            </configuration>
          </execution>
          <execution>
            <id>npm run test</id>
            <phase>test</phase>
            <goals>
              <goal>npm</goal>
            </goals>
            <configuration>
              <arguments>test</arguments>
            </configuration>
          </execution>
          <execution>
            <id>npm run build</id>
            <phase>compile</phase>
            <goals>
              <goal>npm</goal>
            </goals>
            <configuration>
              <arguments>run build</arguments>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <configuration>
          <packagingExcludes>**/*.less,**/*.vue,vue-app/**,mocks/**/*,**-dev.*</packagingExcludes>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>
