<?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>org.optaweb.employeerostering</groupId>
    <artifactId>employee-rostering</artifactId>
    <version>7.11.0.Final</version>
  </parent>

  <artifactId>employee-rostering-gwtui</artifactId>
  <packaging>gwt-app</packaging>

  <name>Employee Rostering as a Service GWT UI</name>

  <dependencies>
    <!-- gwt-dev must be first so the correct JDT ECJ version is on GWT's compiler's classpath -->
    <dependency>
      <groupId>com.google.gwt</groupId>
      <artifactId>gwt-dev</artifactId>
      <exclusions>
        <exclusion>
          <!-- Contains a ServletContainerInitializer that breaks the EmbeddedWildFlyLauncher during GWT Super Dev Mode -->
          <groupId>org.eclipse.jetty</groupId>
          <artifactId>apache-jsp</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.optaweb.employeerostering</groupId>
      <artifactId>employee-rostering-shared-gwt</artifactId>
      <type>gwt-lib</type>
      <!-- Workaround for https://issues.jboss.org/browse/ERRAI-1094 -->
      <exclusions>
        <exclusion>
          <groupId>org.kie</groupId>
          <artifactId>kie-api</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.drools</groupId>
          <artifactId>drools-core</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.drools</groupId>
          <artifactId>drools-compiler</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <!-- GWT -->
    <dependency>
      <groupId>com.google.gwt</groupId>
      <artifactId>gwt-user</artifactId>
    </dependency>
    <dependency>
      <groupId>com.github.nmorel.gwtjackson</groupId>
      <artifactId>gwt-jackson</artifactId>
    </dependency>
    <dependency>
      <groupId>com.github.nmorel.gwtjackson</groupId>
      <artifactId>gwt-jackson-rest-processor</artifactId>
    </dependency>
    <dependency>
      <groupId>org.gwtbootstrap3</groupId>
      <artifactId>gwtbootstrap3</artifactId>
    </dependency>
    <dependency>
      <groupId>org.gwtbootstrap3</groupId>
      <artifactId>gwtbootstrap3-extras</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.errai</groupId>
      <artifactId>errai-ioc</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.errai</groupId>
      <artifactId>errai-cdi-client</artifactId>
    </dependency>
    <dependency><!-- TODO Remove me, we don't use JPA on the client, but removing this gives blank screen at runtime -->
      <groupId>org.jboss.errai</groupId>
      <artifactId>errai-jpa-client</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.errai</groupId>
      <artifactId>errai-javax-enterprise</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.errai</groupId>
      <artifactId>errai-navigation</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.errai</groupId>
      <artifactId>errai-data-binding</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.errai</groupId>
      <artifactId>errai-validation</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.errai</groupId>
      <artifactId>errai-ui</artifactId>
    </dependency>
    <dependency>
      <!-- Only used for EmbeddedWildFlyLauncher during GWT Super Dev Mode -->
      <groupId>org.jboss.errai</groupId>
      <artifactId>errai-cdi-jboss</artifactId>
      <scope>runtime</scope>
    </dependency>
     <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-simple</artifactId>
    </dependency>
    <dependency>
      <groupId>org.hibernate</groupId>
      <artifactId>hibernate-validator</artifactId>
    </dependency>
    <dependency>
      <groupId>org.hibernate</groupId>
      <artifactId>hibernate-validator</artifactId>
      <classifier>sources</classifier>
     </dependency>
     
     <!-- TESTS -->
     <dependency>
      <groupId>com.google.gwt.gwtmockito</groupId>
      <artifactId>gwtmockito</artifactId>
      <scope>test</scope>
     </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>net.ltgt.gwt.maven</groupId>
        <artifactId>gwt-maven-plugin</artifactId>
        <configuration>
          <moduleName>org.optaweb.employeerostering.gwtui.WorkerRosteringWebapp</moduleName>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>test</goal>
            </goals>
            <configuration>
              <includes>
                <include>**/*Test.java</include>
              </includes>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>unpack-patternfly</id>
            <phase>process-resources</phase>
            <goals>
              <goal>unpack</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>org.webjars.bower</groupId>
                  <artifactId>patternfly</artifactId>
                  <version>${version.org.webjars.bower.org.patternfly}</version>
                  <type>jar</type>
                  <overWrite>true</overWrite>
                  <outputDirectory>${project.build.directory}/patternfly</outputDirectory>
                </artifactItem>
              </artifactItems>
              <overWriteReleases>false</overWriteReleases>
              <overWriteSnapshots>true</overWriteSnapshots>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <executions>
          <execution>
            <id>copy-patternfly-resources</id>
            <phase>process-resources</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.outputDirectory}/org/optaweb/employeerostering/gwtui/public/</outputDirectory>
              <resources>
                <resource>
                  <directory>
                    ${project.build.directory}/patternfly/META-INF/resources/webjars/patternfly/${version.org.webjars.bower.org.patternfly}/dist
                  </directory>
                  <includes>
                    <include>**</include>
                  </includes>
                  <excludes>
                    <exclude>tests/**</exclude>
                  </excludes>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
