<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::Server::Webapp</name>
  <groupId>org.jboss.bpm</groupId>
  <artifactId>gwt-console-server</artifactId>
  <packaging>war</packaging>

  <!-- Parent -->
  <parent>
    <groupId>org.jboss.bpm</groupId>
    <artifactId>gwt-console-servermodule</artifactId>
    <version>2.3.2.Final</version>
    <relativePath>../pom.xml</relativePath>
  </parent>

  <!-- Properties -->
  <properties>
    <json-lib.version>2.2.3</json-lib.version>
    <slf4j.version>1.6.0</slf4j.version>
  </properties>

  <dependencies>
    <!-- Module -->
    <dependency>
      <groupId>org.jboss.bpm</groupId>
      <artifactId>gwt-console-server-integration</artifactId>
      <version>${project.version}</version>
    </dependency>

    <!-- GWT related -->
    <dependency>
      <groupId>com.google.gwt</groupId>
      <artifactId>gwt-servlet</artifactId>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>com.google.gwt</groupId>
      <artifactId>gwt-user</artifactId>
      <scope>provided</scope>
    </dependency>

    <!-- Other -->
    <dependency>
         <groupId>org.slf4j</groupId>
         <artifactId>slf4j-api</artifactId>
         <version>${slf4j.version}</version>
		 <scope>provided</scope>
     </dependency>
     <dependency>
         <groupId>org.slf4j</groupId>
         <artifactId>slf4j-simple</artifactId>
         <version>${slf4j.version}</version>
		 <scope>provided</scope>
     </dependency>
     <dependency>
         <groupId>org.slf4j</groupId>
         <artifactId>slf4j-log4j12</artifactId>
         <version>${slf4j.version}</version>
		 <scope>provided</scope>
         <exclusions>
          <exclusion>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
          </exclusion>
         </exclusions>
     </dependency>      

    <dependency>
      <groupId>javax.ejb</groupId>
      <artifactId>ejb-api</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>javax.xml.bind</groupId>
      <artifactId>jaxb-api</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.jboss.resteasy</groupId>
      <artifactId>resteasy-jaxrs</artifactId>
      <exclusions>
        <exclusion>
          <groupId>javax.servlet</groupId>
          <artifactId>servlet-api</artifactId>
        </exclusion>
        <exclusion>
          <groupId>javax.activation</groupId>
          <artifactId>activation</artifactId>
        </exclusion>
        <exclusion>
          <groupId>commons-httpclient</groupId>
          <artifactId>commons-httpclient</artifactId>
        </exclusion>
        <exclusion>
          <groupId>javax.mail</groupId>
          <artifactId>mail</artifactId>
        </exclusion>
        <exclusion>
          <groupId>tjws</groupId>
          <artifactId>webserver</artifactId>
        </exclusion>
        <exclusion>
          <groupId>com.sun.xml.bind</groupId>
          <artifactId>jaxb-impl</artifactId>
        </exclusion>
        <exclusion>
          <groupId>javax.xml.bind</groupId>
          <artifactId>jaxb-api</artifactId>
        </exclusion>
        <exclusion>
          <groupId>javax.xml.stream</groupId>
          <artifactId>stax-api</artifactId>
        </exclusion>
        <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-simple</artifactId>
        </exclusion>
        <exclusion>
        	<groupId>javassist</groupId>
            <artifactId>javassist</artifactId>
        </exclusion>
        <exclusion>
        	<groupId>org.slf4j</groupId>
            <artifactId>jcl-over-slf4j</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
     <dependency>
     	<groupId>org.slf4j</groupId>
        <artifactId>jcl-over-slf4j</artifactId>
        <version>${slf4j.version}</version>
     </dependency>
      <!-- <dependency>
          <groupId>javassist</groupId>
          <artifactId>javassist</artifactId>
          <version>3.6.0.GA</version>
          <scope>provided</scope>
      </dependency> -->

    <dependency>
      <groupId>org.jboss.resteasy</groupId>
      <artifactId>resteasy-multipart-provider</artifactId>
      <exclusions>
        <exclusion>
          <groupId>javax.servlet</groupId>
          <artifactId>servlet-api</artifactId>
        </exclusion>
        <exclusion>
          <groupId>javax.activation</groupId>
          <artifactId>activation</artifactId>
        </exclusion>
        <exclusion>
          <groupId>commons-httpclient</groupId>
          <artifactId>commons-httpclient</artifactId>
        </exclusion>
        <exclusion>
          <groupId>javax.mail</groupId>
          <artifactId>mail</artifactId>
        </exclusion>
        <exclusion>
          <groupId>tjws</groupId>
          <artifactId>webserver</artifactId>
        </exclusion>
        <exclusion>
          <groupId>com.sun.xml.bind</groupId>
          <artifactId>jaxb-impl</artifactId>
        </exclusion>
        <exclusion>
          <groupId>javax.xml.bind</groupId>
          <artifactId>jaxb-api</artifactId>
        </exclusion>
        <exclusion>
          <groupId>javax.xml.stream</groupId>
          <artifactId>stax-api</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>com.google.code.gson</groupId>
      <artifactId>gson</artifactId>
    </dependency>
    <dependency>
      <groupId>net.sf.json-lib</groupId>
      <artifactId>json-lib</artifactId>
      <version>${json-lib.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>commons-fileupload</groupId>
      <artifactId>commons-fileupload</artifactId>
    </dependency>
    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
    </dependency>
    <dependency>
      <groupId>javax.xml</groupId>
      <artifactId>jaxb-impl</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.jboss.bpm</groupId>
      <artifactId>report-core</artifactId>
      <exclusions>
          <exclusion>
              <groupId>commons-logging</groupId>
              <artifactId>commons-logging</artifactId>
          </exclusion>
      </exclusions>
    </dependency>

  </dependencies>

  <build>
    <!--  Include SOURCE in output artifact for GWT (GWT libraries must include source) -->
    <!--resources>
      <resource>
        <directory>src/main/java</directory>
      </resource>
      <resource>
        <directory>src/main/resources</directory>
      </resource>
    </resources-->

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
        </configuration>
      </plugin>

      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <finalName>${project.build.finalName}</finalName>
              <appendAssemblyId>true</appendAssemblyId>
              <descriptors>
                <descriptor>scripts/assembly-config.xml</descriptor>
              </descriptors>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <configuration>
          <webResources>
            <resource>
              <!-- this is relative to the pom.xml directory -->
              <directory>src/main/templates</directory>
              <filtering>true</filtering>
            </resource>
          </webResources>
        </configuration>
        <executions>
          <execution>
            <id>default-war</id>
            <configuration>
              <filters>
                <filter>${project.basedir}/src/main/properties/default.properties</filter>
              </filters>
            </configuration>
          </execution>
        </executions>
      </plugin>


      <plugin>
         <artifactId>maven-antrun-plugin</artifactId>
         <executions>
          <execution>
            <id>generate-docs</id>
            <phase>prepare-package</phase>
            <goals>
                <goal>run</goal>
            </goals>
            <configuration>
                <tasks>
                    <java classname="org.jboss.bpm.console.server.util.RsDocGenerator">
                        <arg value="${project.build.directory}/docs"/>
                        <classpath>
                            <pathelement path="${java.class.path}"/>
                            <path refid="maven.compile.classpath"/>
                        </classpath>
                    </java>
                </tasks>
             </configuration>
          </execution>
         </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
          <execution>
            <id>docs-package</id>
            <phase>package</phase>
            <configuration>
              <classifier>docs</classifier>
              <classesDirectory>${project.build.directory}/docs</classesDirectory>
            </configuration>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

    </plugins>
    
    <finalName>gwt-console-server</finalName>
  </build>

  <!--
     jBPM profile
  -->
  <profiles>
    <profile>
      <id>jbpm</id>
      <activation>
      	<property>
        	<name>console.profile</name>
            	<value>jbpm</value>
            </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <executions>
              <execution>
                <id>jbpm-war</id>
                <goals>
                  <goal>war</goal>
                </goals>
                <configuration>
                  <filters>
                    <filter>${project.basedir}/src/main/properties/jbpm.properties</filter>
                  </filters>
                  <webappDirectory>${project.build.directory}/jbpm-war</webappDirectory>
                  <classifier>jbpm</classifier>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>drools</id>
      <activation>
        <property>
          <name>console.profile</name>
          <value>drools</value>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <executions>
              <execution>
                <id>drools-war</id>
                <goals>
                  <goal>war</goal>
                </goals>
                <configuration>
                  <filters>
                    <filter>${project.basedir}/src/main/properties/drools.properties</filter>
                  </filters>
                  <webappDirectory>${project.build.directory}/drools-war</webappDirectory>
                  <classifier>drools</classifier>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>riftsaw</id>
      <activation>
        <property>
          <name>console.profile</name>
          <value>riftsaw</value>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <executions>
              <execution>
                <id>riftsaw-war</id>
                <goals>
                  <goal>war</goal>
                </goals>
                <configuration>
                  <filters>
                    <filter>${project.basedir}/src/main/properties/riftsaw.properties</filter>
                  </filters>
                  <webappDirectory>${project.build.directory}/riftsaw-war</webappDirectory>
                  <classifier>riftsaw</classifier>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
