<?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>
    <name>JBoss BPM - Console::GUI::Webapp</name>
    <artifactId>gwt-console</artifactId>
    <packaging>war</packaging>

    <!-- Parent -->
    <parent>
        <groupId>org.jboss.bpm</groupId>
        <artifactId>gwt-console-gui</artifactId>
        <version>2.4.6.Final</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <properties>
        <default.war.output>${project.build.directory}/default-war</default.war.output>
    </properties>

    <!--  Dependencies -->
    <dependencies>

        <dependency>
            <groupId>org.jboss.errai</groupId>
            <artifactId>errai-bus</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-simple</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-log4j12</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>javassist</groupId>
                    <artifactId>javassist</artifactId>
                </exclusion>
                <exclusion>
                	<groupId>xml-apis</groupId>
                	<artifactId>xml-apis</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.jboss.errai</groupId>
            <artifactId>errai-tools</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.jboss.errai</groupId>
            <artifactId>errai-widgets</artifactId>
            <classifier>sources</classifier>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.jboss.errai</groupId>
            <artifactId>errai-workspaces</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.jboss.bpm</groupId>
            <artifactId>activity-monitor-ui-lib</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.hibernate</groupId>
                    <artifactId>hibernate-core</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.hibernate</groupId>
                    <artifactId>hibernate-annotations</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.hibernate</groupId>
                    <artifactId>hibernate-entitymanager</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.hibernate</groupId>
                    <artifactId>hibernate-tools</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.jboss.bpm</groupId>
            <artifactId>activity-monitor-ui-lib</artifactId>
            <classifier>sources</classifier>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.jboss.bpm</groupId>
            <artifactId>activity-monitor-model</artifactId>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.hibernate</groupId>
                    <artifactId>hibernate-core</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.hibernate</groupId>
                    <artifactId>hibernate-annotations</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.hibernate</groupId>
                    <artifactId>hibernate-entitymanager</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.hibernate</groupId>
                    <artifactId>hibernate-tools</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>javassist</groupId>
                    <artifactId>javassist</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.jboss.bpm</groupId>
            <artifactId>activity-monitor-model</artifactId>
            <scope>provided</scope>
            <classifier>sources</classifier>
        </dependency>


        <dependency>
            <groupId>org.jboss.bpm</groupId>
            <artifactId>gwt-console-rpc</artifactId>
            <classifier>sources</classifier>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.bpm</groupId>
            <artifactId>gwt-console-rpc</artifactId>
            <scope>provided</scope>
            <exclusions>
            	<exclusion>
            		<groupId>xml-apis</groupId>
            		<artifactId>xml-apis</artifactId>
            	</exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.jboss.bpm</groupId>
            <artifactId>report-shared</artifactId>
            <classifier>sources</classifier>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.bpm</groupId>
            <artifactId>report-shared</artifactId>
        </dependency>

        <!-- GWT -->
        <dependency>
            <groupId>com.google.gwt</groupId>
            <artifactId>gwt-servlet</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.google.gwt</groupId>
            <artifactId>gwt-user</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.google.gwt</groupId>
            <artifactId>gwt-dev</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.mvel</groupId>
            <artifactId>mvel2</artifactId>
        </dependency>

        <dependency>
            <groupId>com.google.code.guice</groupId>
            <artifactId>guice</artifactId>
        </dependency>
        <dependency>
            <groupId>com.google.code.guice</groupId>
            <artifactId>guice</artifactId>
            <classifier>aopalliance</classifier>
        </dependency>

        <!-- GWT extensions -->

        <!-- Mosaic -->
        <!--dependency>
            <groupId>com.googlecode.gwtmosaic</groupId>
            <artifactId>gwt-mosaic</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.googlecode.gwtmosaic</groupId>
            <artifactId>gwt-beans-binding</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.googlecode.gwtmosaic</groupId>
            <artifactId>gwt-dnd</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.googlecode.gwtmosaic</groupId>
            <artifactId>gwtx</artifactId>
            <scope>provided</scope>
        </dependency-->

        <dependency>
            <groupId>com.googlecode.mvc4g</groupId>
            <artifactId>mvc4g</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- 3rd party -->

        <dependency>
          <groupId>org.overlord</groupId>
          <artifactId>overlord-commons-auth</artifactId>
        </dependency>
        <dependency>
            <groupId>org.overlord</groupId>
            <artifactId>overlord-commons-auth-jboss7</artifactId>
        </dependency>
        <dependency>
            <groupId>org.overlord</groupId>
            <artifactId>overlord-commons-auth-jetty8</artifactId>
        </dependency>
        <dependency>
            <groupId>org.overlord</groupId>
            <artifactId>overlord-commons-auth-tomcat7</artifactId>
        </dependency>
        <dependency>
          <groupId>org.overlord</groupId>
          <artifactId>overlord-commons-config</artifactId>
        </dependency>
        <dependency>
          <groupId>org.overlord</groupId>
          <artifactId>overlord-commons-osgi</artifactId>
        </dependency>
        <dependency>
          <groupId>org.overlord</groupId>
          <artifactId>overlord-commons-gwt</artifactId>
        </dependency>

        <dependency>
            <groupId>org.picketbox</groupId>
            <artifactId>picketbox</artifactId>
        </dependency>
        <dependency>
            <groupId>org.picketlink</groupId>
            <artifactId>picketlink-federation</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jboss.logging</groupId>
            <artifactId>jboss-logging</artifactId>
        </dependency>

        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>commons-configuration</groupId>
            <artifactId>commons-configuration</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>javax.xml.bind</groupId>
            <artifactId>jaxb-api</artifactId>
            <classifier>sources</classifier>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.xml.stream</groupId>
            <artifactId>stax-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.activation</groupId>
            <artifactId>activation</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>log4j</groupId>
                    <artifactId>log4j</artifactId>
                </exclusion>
            </exclusions>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
        </dependency>

        <dependency>
          <groupId>org.osgi</groupId>
          <artifactId>org.osgi.core</artifactId>
          <scope>provided</scope>
        </dependency>

    </dependencies>
    
    <!-- Plugins -->
    <build>
        <finalName>gwt-console</finalName>

        <plugins>

            <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>OBF</style>
                    <warSourceDirectory>${project.build.directory}/gwt-compiled</warSourceDirectory>
                    <webappDirectory>${project.build.directory}/gwt-compiled</webappDirectory>
                </configuration>
                <executions>
                    <execution>
                      <id>gwt-clean-compile</id>
                        <goals>
                            <goal>clean</goal>
                            <goal>compile</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
              <artifactId>maven-resources-plugin</artifactId>
              <configuration>
                <resources>
                  <resource>
                    <directory>${project.basedir}/src/main/templates</directory>
                    <filtering>true</filtering>
                  </resource>
                </resources>
              </configuration>
              
              <executions>
                <execution>
                  <id>hosted-mode-default</id>
                  <phase>generate-sources</phase>
                  <goals>
                    <goal>copy-resources</goal>
                  </goals>
                  <configuration>
                    <outputDirectory>${default.war.output}</outputDirectory>
                    <filters>
                      <filter>${project.basedir}/src/main/properties/default.properties</filter>
                    </filters>
                  </configuration>
                </execution>
                <execution>
                  <id>deploy-mode-default</id>
                  <phase>prepare-package</phase>
                  <goals>
                    <goal>copy-resources</goal>
                  </goals>
                  <configuration>
                    <outputDirectory>${default.war.output}</outputDirectory>
                    <filters>
                      <filter>${project.basedir}/src/main/properties/common-deploy.properties</filter>
                      <filter>${project.basedir}/src/main/properties/default.properties</filter>
                    </filters>
                    <excludes>
                      <exclude>**/errai-proxy.json</exclude>
                    </excludes>
                  </configuration>
                </execution>
              </executions>
            </plugin>
            
            <plugin>
                <artifactId>maven-war-plugin</artifactId>
                <configuration>
                    <warSourceExcludes>.gwt-tmp/**</warSourceExcludes>
                    <webResources>
                      <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>
                    <webappDirectory>${default.war.output}</webappDirectory>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <id>generate-version-class</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <tasks>
                                <ant antfile="scripts/antrun-version.xml" inheritAll="false" inheritRefs="false">
                                    <property name="version" value="${project.version}" />
                                    <property name="src.dir" value="${project.build.directory}/generated-sources/antrun" />
                                </ant>
                            </tasks>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
              <groupId>org.codehaus.mojo</groupId>
              <artifactId>build-helper-maven-plugin</artifactId>
              <executions>
                <execution>
                  <id>include-antrun-sources</id>
                  <phase>process-sources</phase>
                  <goals>
                    <goal>add-source</goal>
                  </goals>
                  <configuration>
                    <sources>
                      <source>${project.build.directory}/generated-sources/antrun</source>
                    </sources>
                  </configuration>
                </execution>
              </executions>
            </plugin>
        </plugins>
        
        <pluginManagement>
          <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <configuration>
                    <artifactItems>
                        <artifactItem>
                            <version>${project.version}</version>
                            <type>jar</type>
                            <overWrite>true</overWrite>
                            <includes>**/*</includes>
                        </artifactItem>
                    </artifactItems>
                </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
    </build>

    <profiles>

        <profile>
            <id>quick-hosted-mode</id>
            <activation>
                <property>
                    <name>hosted</name>
                </property>
            </activation>
            <properties>
                <google.webtoolkit.compileSkip>true</google.webtoolkit.compileSkip>
                <o>true</o> <!-- offline -->
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>gwt-maven-plugin</artifactId>
                        <version>${gwt.maven}</version>
                        <configuration>
                            <draftCompile>true</draftCompile>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>jboss</id>
            <dependencies>
                <dependency>
                    <groupId>dom4j</groupId>
                    <artifactId>dom4j</artifactId>
                    <scope>provided</scope>
                </dependency>

                <!-- <dependency>
                    <groupId>javassist</groupId>
                    <artifactId>javassist</artifactId>
                    <scope>provided</scope>
                    <version>3.12.1.GA</version>
                </dependency> -->
            </dependencies>
        </profile>
        
        <!--
         =======================================================
          jBPM Profile (default)
         =======================================================
        -->
        <profile>
            <id>jbpm</id>
            <activation>
                <property>
                    <name>console.profile</name>
                    <value>jbpm</value>
                </property>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>org.jboss.bpm</groupId>
                    <artifactId>gwt-console-profile-jbpm</artifactId>
                    <scope>provided</scope>
                </dependency>
            </dependencies>
            <properties>
                <console.app.webcontext>jbpm-console</console.app.webcontext>
              	<jbpm.war.output>${project.build.directory}/jbpm-war</jbpm.war.output>
            </properties>
            <build>
                <plugins>
                  <plugin>
                    <artifactId>maven-resources-plugin</artifactId>
                    <executions>
                      <execution>
                        <id>hosted-mode-jbpm</id>
                        <phase>generate-sources</phase>
                        <goals>
                          <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                          <outputDirectory>${jbpm.war.output}</outputDirectory>
                          <filters>
                            <filter>${project.basedir}/src/main/properties/jbpm.properties</filter>
                            <filter>${project.basedir}/src/main/properties/common-deploy.properties</filter>
                          </filters>
                        </configuration>
                      </execution>
                      <execution>
                        <id>deploy-mode-jbpm</id>
                        <phase>prepare-package</phase>
                        <goals>
                          <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                          <outputDirectory>${jbpm.war.output}</outputDirectory>
                          <filters>
                            <filter>${project.basedir}/src/main/properties/common-deploy.properties</filter>
                            <filter>${project.basedir}/src/main/properties/jbpm.properties</filter>
                          </filters>
                          <excludes>
                            <exclude>**/errai-proxy.json</exclude>
                          </excludes>
                        </configuration>
                      </execution>
                    </executions>
                  </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>unpack-profile-jbpm</id>
                                <phase>process-resources</phase>
                                <goals>
                                    <goal>unpack</goal>
                                </goals>
                                <configuration>
                                    <artifactItems>
                                        <artifactItem>
                                            <groupId>org.jboss.bpm</groupId>
                                            <artifactId>gwt-console-profile-jbpm</artifactId>
                                            <version>${version}</version>
                                            <type>jar</type>
                                            <overWrite>true</overWrite>
                                            <outputDirectory>${jbpm.war.output}/app</outputDirectory>
                                            <includes>**/*</includes>
                                        </artifactItem>
                                    </artifactItems>
                                </configuration>
                            </execution>
                            <execution>
                                <id>unpack-profile-jbpm2</id>
                                <phase>prepare-package</phase>
                                <goals>
                                    <goal>unpack</goal>
                                </goals>
                                <configuration>
                                    <artifactItems>
                                        <artifactItem>
                                            <groupId>org.jboss.bpm</groupId>
                                            <artifactId>gwt-console-profile-jbpm</artifactId>
                                            <version>${version}</version>
                                            <type>jar</type>
                                            <overWrite>true</overWrite>
                                            <outputDirectory>${jbpm.war.output}</outputDirectory>
                                            <!-- <excludes>
	                                            <exclude>**/app.html</exclude>
	                                            <exclude>**/errai-proxy.json</exclude>
                                            </excludes> -->
                                        </artifactItem>
                                    </artifactItems>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-war-plugin</artifactId>
                        <executions>
                          <execution>
                            <id>jbpm-war</id>
                            <goals>
                              <goal>war</goal>
                            </goals>
                            <configuration>
                              <webappDirectory>${jbpm.war.output}</webappDirectory>
                              <classifier>jbpm</classifier>
                            </configuration>
                          </execution>
                        </executions>
                    </plugin>
                </plugins>

            </build>
        </profile>

        <!--
         =======================================================
          Riftsaw Profile
         =======================================================
        -->
        <profile>
            <id>riftsaw</id>
            <activation>
                <property>
                    <name>console.profile</name>
                    <value>riftsaw</value>
                </property>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>org.jboss.bpm</groupId>
                    <artifactId>gwt-console-profile-riftsaw</artifactId>
                    <scope>provided</scope>
                </dependency>
            </dependencies>
            <properties>
              <riftsaw.war.output>${project.build.directory}/riftsaw-war</riftsaw.war.output>
            </properties>
            <build>
                <plugins>
                  <plugin>
                    <artifactId>maven-resources-plugin</artifactId>
                    <executions>
                      <execution>
                        <id>hosted-mode-riftsaw</id>
                        <phase>generate-sources</phase>
                        <goals>
                          <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                          <outputDirectory>${riftsaw.war.output}</outputDirectory>
                          <filters>
                            <filter>${project.basedir}/src/main/properties/riftsaw.properties</filter>
                            <filter>${project.basedir}/src/main/properties/common-deploy.properties</filter>
                          </filters>
                        </configuration>
                      </execution>
                      <execution>
                        <id>deploy-mode-riftsaw</id>
                        <phase>prepare-package</phase>
                        <goals>
                          <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                          <outputDirectory>${riftsaw.war.output}</outputDirectory>
                          <filters>
                            <filter>${project.basedir}/src/main/properties/common-deploy.properties</filter>
                            <filter>${project.basedir}/src/main/properties/riftsaw.properties</filter>
                          </filters>
                          <excludes>
                            <exclude>**/errai-proxy.json</exclude>
                          </excludes>
                        </configuration>
                      </execution>
                    </executions>
                  </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <executions>

                            <execution>
                                <id>unpack-profile-riftsaw</id>
                                <phase>process-resources</phase>
                                <goals>
                                    <goal>unpack</goal>
                                </goals>
                                <configuration>
                                    <artifactItems>
                                        <artifactItem>
                                            <groupId>org.jboss.bpm</groupId>
                                            <artifactId>gwt-console-profile-riftsaw</artifactId>
                                            <outputDirectory>${riftsaw.war.output}/app</outputDirectory>
                                        </artifactItem>
                                    </artifactItems>
                                </configuration>
                            </execution>
                            <execution>
                                <id>unpack-profile-riftsaw2</id>
                                <phase>prepare-package</phase>
                                <goals>
                                    <goal>unpack</goal>
                                </goals>
                                <configuration>
                                    <artifactItems>
                                        <artifactItem>
                                            <groupId>org.jboss.bpm</groupId>
                                            <artifactId>gwt-console-profile-riftsaw</artifactId>
                                            <outputDirectory>${riftsaw.war.output}/app</outputDirectory>
                                            <excludes>**/app.html</excludes>
                                        </artifactItem>
                                    </artifactItems>
                                </configuration>
                            </execution>
                            <execution>
                                <id>unpack-profile-riftsaw3</id>
                                <phase>prepare-package</phase>
                                <goals>
                                    <goal>unpack</goal>
                                </goals>
                                <configuration>
                                    <artifactItems>
                                        <artifactItem>
                                            <groupId>org.jboss.bpm</groupId>
                                            <artifactId>gwt-console-profile-riftsaw</artifactId>
                                            <outputDirectory>${riftsaw.war.output}</outputDirectory>
                                            <includes>**/app.html</includes>
                                        </artifactItem>
                                    </artifactItems>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-war-plugin</artifactId>
                        <executions>
                          <execution>
                            <id>riftsaw-war</id>
                            <goals>
                              <goal>war</goal>
                            </goals>
                            <configuration>
                              <webappDirectory>${riftsaw.war.output}</webappDirectory>
                              <classifier>riftsaw</classifier>
                            </configuration>
                          </execution>
                        </executions>
                    </plugin>

                </plugins>
            </build>
        </profile>

    </profiles>


</project>
