<?xml version="1.0" encoding="UTF-8"?>
<project>
    <modelVersion>4.0.0</modelVersion>
    <name>JBoss BPM - Console::GUI::Webapp Parent</name>
    <groupId>org.jboss.bpm</groupId>
    <artifactId>gwt-console-war-parent</artifactId>
    <packaging>pom</packaging>

    <!-- Parent -->
    <parent>
        <groupId>org.jboss.bpm</groupId>
        <artifactId>gwt-console-gui</artifactId>
        <version>2.3.8.Final</version>
        <relativePath>../pom.xml</relativePath>
    </parent>
    
    <modules>
      <module>jbpm</module>
      <module>riftsaw</module>
    </modules>
    
    <dependencies>
      <dependency>
        <groupId>org.jboss.bpm</groupId>
        <artifactId>gwt-console-war-base</artifactId>
        <version>${project.version}</version>
        <scope>provided</scope>
        <type>war</type>
      </dependency>
      <!-- used to explode sources for GWT-compile -->
      <dependency>
        <groupId>org.jboss.bpm</groupId>
        <artifactId>gwt-console-app-base</artifactId>
        <version>${project.version}</version>
        <scope>provided</scope>
        <classifier>sources</classifier>
      </dependency>
      <!-- used to explode/filter properties specific to app -->
      <dependency>
        <groupId>org.jboss.bpm</groupId>
        <artifactId>gwt-console-war-templates</artifactId>
        <version>${project.version}</version>
        <scope>provided</scope>
      </dependency>
    </dependencies>

    <!-- Plugins -->
    <build>
      <sourceDirectory>${project.build.directory}/generated-sources/unpacked-gwt-sources</sourceDirectory>
      <resources>
        <resource>
          <directory>${project.build.sourceDirectory}</directory>
          <includes>
            <include>*.properties</include>
            <include>*.json</include>
            <include>*.xml</include>
          </includes>
          <filtering>false</filtering>
        </resource>
        <resource>
          <directory>src/main/resources</directory>
        </resource>
      </resources>
      <pluginManagement>
        <plugins>
            <plugin>
              <artifactId>maven-dependency-plugin</artifactId>
              <executions>
                <execution>
                  <id>unpack-gwt-sources</id>
                  <phase>generate-sources</phase>
                  <goals>
                    <goal>unpack-dependencies</goal>
                  </goals>
                  <configuration>
                    <includeArtifactIds>gwt-console-app-base</includeArtifactIds>
                    <includeClassifiers>sources</includeClassifiers>
                    <outputDirectory>${project.build.sourceDirectory}</outputDirectory>
                  </configuration>
                </execution>
                <execution>
                  <id>unpack-templates</id>
                  <phase>generate-resources</phase>
                  <goals>
                    <goal>unpack-dependencies</goal>
                  </goals>
                  <configuration>
                    <includeArtifactIds>gwt-console-war-templates</includeArtifactIds>
                    <outputDirectory>${project.build.directory}/unpacked-templates</outputDirectory>
                  </configuration>
                </execution>
              </executions>
            </plugin>
            <plugin>
              <artifactId>maven-resources-plugin</artifactId>
              <executions>
                <execution>
                  <id>filter-unpacked-templates</id>
                  <phase>process-resources</phase>
                  <goals>
                    <goal>copy-resources</goal>
                  </goals>
                  <configuration>
                    <resources>
                      <resource>
                        <directory>${project.build.directory}/unpacked-templates</directory>
                        <filtering>true</filtering>
                      </resource>
                    </resources>
                    <outputDirectory>${project.build.directory}/filtered-templates</outputDirectory>
                  </configuration>
                </execution>
              </executions>
            </plugin>
            <plugin>
                <artifactId>maven-war-plugin</artifactId>
                <configuration>
                  <packagingExcludes>WEB-INF/classes/toolset-profile.properties</packagingExcludes>
                  <warSourceExcludes>.gwt-tmp/**</warSourceExcludes>
                    <webResources>
                      <webResource>
                        <directory>${project.build.directory}/filtered-templates</directory>
                      </webResource>
                      <webResource>
                        <directory>${project.build.directory}/gwt-compiled</directory>
                        <excludes>
                            <exclude>app/.junit_symbolMaps/*.symbolMap</exclude>
                            <exclude>app/junit.html</exclude>
                            <exclude>app/junit-standards.html</exclude>
                        </excludes>
                      </webResource>
                    </webResources>
                    <overlays>
                      <overlay>
                        <groupId>org.jboss.bpm</groupId>
                        <artifactId>gwt-console-war-base</artifactId>
                      </overlay>
                    </overlays>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>gwt-maven-plugin</artifactId>
                <configuration>
                    <inplace>true</inplace>
                    <logLevel>INFO</logLevel>
                    <runTarget>app.html</runTarget>
                    <extraJvmArgs>-Xmx1024m -XX:+UseParallelGC -server</extraJvmArgs>
                    <localWorkers>2</localWorkers>
                    <soyc>false</soyc>
                    <style>PRETTY</style>
                    <warSourceDirectory>${project.build.directory}/gwt-compiled</warSourceDirectory>
                    <webappDirectory>${project.build.directory}/gwt-compiled</webappDirectory>
                </configuration>
                <!-- <dependencies>
                  <dependency>
                    <groupId>com.google.gwt</groupId>
                    <artifactId>gwt-servlet</artifactId>
                    <version>${gwt.version}</version>
                  </dependency>
                  <dependency>
                    <groupId>com.google.gwt</groupId>
                    <artifactId>gwt-user</artifactId>
                    <version>${gwt.version}</version>
                  </dependency>
                  <dependency>
                    <groupId>com.google.gwt</groupId>
                    <artifactId>gwt-dev</artifactId>
                    <version>${gwt.version}</version>
                  </dependency>
                </dependencies> -->
                <executions>
                    <execution>
                      <id>gwt-clean-compile</id>
                      <phase>compile</phase>
                        <goals>
                            <goal>clean</goal>
                            <goal>compile</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
      </pluginManagement>
    </build>

</project>
