<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2015 Red Hat, Inc. and/or its affiliates.
  ~
  ~ Licensed 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>
    <groupId>org.uberfire</groupId>
    <artifactId>uberfire-workbench</artifactId>
    <version>7.73.0.Final</version>
  </parent>

  <artifactId>uberfire-workbench-client-views-patternfly</artifactId>
  <packaging>jar</packaging>

  <name>UberFire Workbench Client Views: PatternFly</name>
  <description>UberFire Workbench Client Views: PatternFly</description>

  <dependencies>
    <dependency>
      <groupId>org.uberfire</groupId>
      <artifactId>uberfire-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.uberfire</groupId>
      <artifactId>uberfire-workbench-client</artifactId>
    </dependency>
    <dependency>
      <groupId>org.uberfire</groupId>
      <artifactId>uberfire-client-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.uberfire</groupId>
      <artifactId>uberfire-commons</artifactId>
    </dependency>
    <dependency>
      <groupId>org.uberfire</groupId>
      <artifactId>uberfire-security-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.gwtbootstrap3</groupId>
      <artifactId>gwtbootstrap3</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.errai</groupId>
      <artifactId>errai-ui</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.errai</groupId>
      <artifactId>errai-common</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.errai</groupId>
      <artifactId>errai-ioc</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.errai</groupId>
      <artifactId>errai-security-server</artifactId>
    </dependency>
    <dependency>
      <groupId>org.kie.soup</groupId>
      <artifactId>kie-soup-commons</artifactId>
    </dependency>
    <dependency>
      <groupId>com.allen-sauer.gwt.dnd</groupId>
      <artifactId>gwt-dnd</artifactId>
    </dependency>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
    </dependency>
    <dependency>
      <groupId>com.google.elemental2</groupId>
      <artifactId>elemental2-dom</artifactId>
    </dependency>
    <dependency>
      <groupId>com.google.jsinterop</groupId>
      <artifactId>jsinterop-annotations</artifactId>
    </dependency>
    <dependency>
      <groupId>com.google.jsinterop</groupId>
      <artifactId>base</artifactId>
    </dependency>

    <dependency>
      <groupId>org.jboss.errai</groupId>
      <artifactId>errai-cdi-client</artifactId>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-simple</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>com.google.gwt</groupId>
      <artifactId>gwt-user</artifactId>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>com.google.gwt.gwtmockito</groupId>
      <artifactId>gwtmockito</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.uberfire</groupId>
      <artifactId>uberfire-commons</artifactId>
      <classifier>sources</classifier>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.uberfire</groupId>
      <artifactId>appformer-js-monaco</artifactId>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.kie.soup</groupId>
      <artifactId>kie-soup-commons</artifactId>
      <classifier>sources</classifier>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.uberfire</groupId>
      <artifactId>uberfire-nio2-model</artifactId>
      <classifier>sources</classifier>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.uberfire</groupId>
      <artifactId>uberfire-api</artifactId>
      <classifier>sources</classifier>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.uberfire</groupId>
      <artifactId>uberfire-client-api</artifactId>
      <classifier>sources</classifier>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.uberfire</groupId>
      <artifactId>uberfire-workbench-client</artifactId>
      <classifier>sources</classifier>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.uberfire</groupId>
      <artifactId>uberfire-security-api</artifactId>
      <classifier>sources</classifier>
      <scope>test</scope>
    </dependency>


    <dependency>
      <groupId>org.uberfire</groupId>
      <artifactId>uberfire-experimental-api</artifactId>
      <classifier>sources</classifier>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.uberfire</groupId>
      <artifactId>uberfire-experimental-client</artifactId>
      <classifier>sources</classifier>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.uberfire</groupId>
      <artifactId>uberfire-testing-utils</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>


  <build>
    <plugins>
      <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>
          <execution>
            <id>unpack-prettify</id>
            <phase>process-resources</phase>
            <goals>
              <goal>unpack</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>org.webjars.bower</groupId>
                  <artifactId>google-code-prettify</artifactId>
                  <version>${version.org.webjars.bower.google-code-prettify}</version>
                  <type>jar</type>
                  <overWrite>true</overWrite>
                  <outputDirectory>${project.build.directory}/prettify</outputDirectory>
                </artifactItem>
              </artifactItems>
              <overWriteReleases>false</overWriteReleases>
              <overWriteSnapshots>true</overWriteSnapshots>
            </configuration>
          </execution>
          <execution>
            <id>unpack-bootstrap-select</id>
            <phase>process-resources</phase>
            <goals>
              <goal>unpack</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>org.webjars.bower</groupId>
                  <artifactId>bootstrap-select</artifactId>
                  <version>${version.org.webjars.bower.bootstrap-select}</version>
                  <type>jar</type>
                  <overWrite>true</overWrite>
                  <outputDirectory>${project.build.directory}/bootstrap-select</outputDirectory>
                </artifactItem>
              </artifactItems>
              <overWriteReleases>false</overWriteReleases>
              <overWriteSnapshots>true</overWriteSnapshots>
            </configuration>
          </execution>
          <execution>
            <id>unpack-moment</id>
            <phase>process-resources</phase>
            <goals>
              <goal>unpack</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>org.webjars.bower</groupId>
                  <artifactId>moment</artifactId>
                  <version>${version.org.webjars.bower.moment}</version>
                  <type>jar</type>
                  <overWrite>true</overWrite>
                  <outputDirectory>${project.build.directory}/moment</outputDirectory>
                </artifactItem>
              </artifactItems>
              <overWriteReleases>false</overWriteReleases>
              <overWriteSnapshots>true</overWriteSnapshots>
            </configuration>
          </execution>
          <execution>
            <id>unpack-moment-timezone</id>
            <phase>process-resources</phase>
            <goals>
              <goal>unpack</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>org.webjars.bower</groupId>
                  <artifactId>moment-timezone</artifactId>
                  <version>${version.org.webjars.bower.moment-timezone}</version>
                  <type>jar</type>
                  <overWrite>true</overWrite>
                  <outputDirectory>${project.build.directory}/moment-timezone</outputDirectory>
                </artifactItem>
              </artifactItems>
              <overWriteReleases>false</overWriteReleases>
              <overWriteSnapshots>true</overWriteSnapshots>
            </configuration>
          </execution>
          <execution>
            <id>unpack-bootstrap-daterangepicker</id>
            <phase>process-resources</phase>
            <goals>
              <goal>unpack</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>org.webjars.bower</groupId>
                  <artifactId>bootstrap-daterangepicker</artifactId>
                  <version>${version.org.webjars.bower.bootstrap-daterangepicker}</version>
                  <type>jar</type>
                  <overWrite>true</overWrite>
                  <outputDirectory>${project.build.directory}/bootstrap-daterangepicker</outputDirectory>
                </artifactItem>
              </artifactItems>
              <overWriteReleases>false</overWriteReleases>
              <overWriteSnapshots>true</overWriteSnapshots>
            </configuration>
          </execution>
          <execution>
            <id>unpack-d3</id>
            <phase>process-resources</phase>
            <goals>
              <goal>unpack</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>org.webjars.bower</groupId>
                  <artifactId>d3</artifactId>
                  <version>${version.org.webjars.bower.d3js}</version>
                  <type>jar</type>
                  <overWrite>true</overWrite>
                  <outputDirectory>${project.build.directory}/d3</outputDirectory>
                </artifactItem>
              </artifactItems>
              <overWriteReleases>false</overWriteReleases>
              <overWriteSnapshots>true</overWriteSnapshots>
            </configuration>
          </execution>
          <execution>
            <id>unpack-appformer-js-monaco</id>
            <phase>process-resources</phase>
            <goals>
              <goal>unpack</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>org.uberfire</groupId>
                  <artifactId>appformer-js-monaco</artifactId>
                  <version>${uberfire.version}</version>
                  <type>jar</type>
                  <overWrite>true</overWrite>
                  <outputDirectory>${project.build.directory}/appformer-js-monaco</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/uberfire/client/views/static</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>
          <execution>
            <id>copy-prettify-resources</id>
            <phase>process-resources</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.outputDirectory}/org/uberfire/client/views/static/prettify</outputDirectory>
              <resources>
                <resource>
                  <directory>${project.build.directory}/prettify/META-INF/resources/webjars/google-code-prettify/${version.org.webjars.bower.google-code-prettify}</directory>
                  <includes>
                    <include>bin/**</include>
                  </includes>
                </resource>
              </resources>
            </configuration>
          </execution>
          <execution>
            <id>copy-bootstrap-select-resources</id>
            <phase>process-resources</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.outputDirectory}/org/uberfire/client/views/static/bootstrap-select</outputDirectory>
              <resources>
                <resource>
                  <directory>${project.build.directory}/bootstrap-select/META-INF/resources/webjars/bootstrap-select/${version.org.webjars.bower.bootstrap-select}/dist</directory>
                  <includes>
                    <include>**</include>
                  </includes>
                </resource>
              </resources>
            </configuration>
          </execution>
          <execution>
            <id>copy-moment-resources</id>
            <phase>process-resources</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.outputDirectory}/org/uberfire/client/views/static/moment</outputDirectory>
              <resources>
                <resource>
                  <directory>${project.build.directory}/moment/META-INF/resources/webjars/moment/${version.org.webjars.bower.moment}/min/</directory>
                  <includes>
                    <include>moment-with-locales.min.js</include>
                  </includes>
                </resource>
              </resources>
            </configuration>
          </execution>
          <execution>
            <id>copy-moment-timezone-resources</id>
            <phase>process-resources</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.outputDirectory}/org/uberfire/client/views/static/moment-timezone</outputDirectory>
              <resources>
                <resource>
                  <directory>${project.build.directory}/moment-timezone/META-INF/resources/webjars/moment-timezone/${version.org.webjars.bower.moment-timezone}/builds/</directory>
                  <includes>
                    <include>moment-timezone-with-data-2012-2022.min.js</include>
                  </includes>
                </resource>
              </resources>
            </configuration>
          </execution>
          <execution>
            <id>copy-bootstrap-daterangepicker-resources</id>
            <phase>process-resources</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.outputDirectory}/org/uberfire/client/views/static/bootstrap-daterangepicker</outputDirectory>
              <resources>
                <resource>
                  <directory>${project.build.directory}/bootstrap-daterangepicker/META-INF/resources/webjars/bootstrap-daterangepicker/${version.org.webjars.bower.bootstrap-daterangepicker}/</directory>
                  <includes>
                    <include>daterangepicker.css</include>
                    <include>daterangepicker.js</include>
                  </includes>
                </resource>
              </resources>
            </configuration>
          </execution>
          <execution>
            <id>copy-d3-resources</id>
            <phase>process-resources</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.outputDirectory}/org/uberfire/client/views/static/d3</outputDirectory>
              <resources>
                <resource>
                  <directory>${project.build.directory}/d3/META-INF/resources/webjars/d3/${version.org.webjars.bower.d3js}/</directory>
                  <includes>
                    <include>d3.min.js</include>
                  </includes>
                </resource>
              </resources>
            </configuration>
          </execution>
          <execution>
            <id>copy-monaco-resources</id>
            <phase>process-resources</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.outputDirectory}/org/uberfire/client/views/static/appformer-js-monaco/</outputDirectory>
              <resources>
                <resource>
                  <directory>${project.build.directory}/appformer-js-monaco/META-INF/resources/webjars/appformer-js-monaco/${uberfire.version}/monaco-editor</directory>
                  <includes>
                    <include>monaco.min.js</include>
                  </includes>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <additionalClasspathElements>
            <additionalClasspathElement>${basedir}/${profile.testOutputDirectory}/</additionalClasspathElement>
            <additionalClasspathElement>${basedir}/src/main/java/</additionalClasspathElement>
            <additionalClasspathElement>${basedir}/src/main/resources/</additionalClasspathElement>
            <additionalClasspathElement>${basedir}/src/test/java/</additionalClasspathElement>
          </additionalClasspathElements>
          <useManifestOnlyJar>false</useManifestOnlyJar>
          <forkMode>pertest</forkMode>
          <!-- DO NOT REMOVE THE errai.ioc.experimental.infer_dependent_by_reachability
            flag or the testsuite WILL fail. -->
          <argLine>-Xmx1500m -Derrai.devel.nocache=true -Derrai.hosted_mode_testing=true -Derrai.ioc.experimental.infer_dependent_by_reachability=true -Dorg.jboss.errai.bus.do_long_poll=false</argLine>

          <systemProperties>
            <!-- Must disable long polling for automated tests to succeed -->
            <property>
              <name>errai.hosted_mode_testing</name>
              <value>true</value>
            </property>
          </systemProperties>
        </configuration>
      </plugin>
    </plugins>
  </build>

</project>
