<?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.drools</groupId>
    <artifactId>guvnor</artifactId>
    <version>5.3.0.Beta1</version>
  </parent>

  <artifactId>guvnor-webapp</artifactId>
  <packaging>war</packaging>

  <name>Guvnor web application</name>
  <description>The web application to create, edit and deploy Drools and jBPM assets.</description>

  <build>
    <plugins>
      <plugin>
        <!--use -Dgwt.compiler.skip=true to skip GWT compiler-->
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>gwt-maven-plugin</artifactId>
        <version>2.3.0</version>
        <configuration>
          <!--
            TODO GUVNOR-1471 From version 2.3.0-1 add this line:
            <deploy>${project.build.directory}/gwt-symbols-deploy</deploy>
          -->
          <!-- The default profile needs to be fast, so we only build 1 permutation { -->
          <module>org.drools.guvnor.FastCompiledGuvnor</module>
          <draftCompile>true</draftCompile>
          <!-- } -->
          <runTarget>org.drools.guvnor.Guvnor/Guvnor.html</runTarget>
          <compileSourcesArtifacts>
            <compileSourcesArtifact>org.drools:droolsjbpm-ide-common</compileSourcesArtifact>
          </compileSourcesArtifacts>
          <gwtSdkFirstInClasspath>true</gwtSdkFirstInClasspath><!-- The GWT compiler must the correct JDT version -->
          <localWorkers>2</localWorkers><!-- Using all workers can temporarily hang the mouse and isn't much faster -->
          <extraJvmArgs>-Xmx512m</extraJvmArgs>
        </configuration>
        <!--<dependencies>-->
          <!--&lt;!&ndash; Explicitly declare gwt dependencies to ensure the use of the same GWT version. &ndash;&gt;-->
          <!--<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>
            <goals>
              <goal>compile</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <inherited>false</inherited>
        <executions>
          <execution>
            <id>clean repository</id>
            <phase>clean</phase>
            <configuration>
              <tasks>
                <delete dir="repository" />
                <delete file="repository.xml" />
              </tasks>
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <inherited>false</inherited>
        <executions>
          <execution>
            <id>clean gwtutil classes</id>
            <phase>prepare-package</phase>
            <configuration>
              <tasks>
                <delete dir="${project.build.directory}/classes/org/drools/guvnor/gwtutil" />
              </tasks>
            </configuration>
          <goals>
            <goal>run</goal>
          </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <configuration>
          <webResources>
            <resource>
              <directory>${basedir}/src/main/webapp</directory>
            </resource>
            <resource>
              <directory>${basedir}/src/main/filtered-webapp</directory>
              <filtering>true</filtering>
            </resource>
          </webResources>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>fullProfile</id>
      <activation>
        <property>
          <name>full</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin><!-- Keep in sync with soa profile -->
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>gwt-maven-plugin</artifactId>
            <configuration>
              <!-- Build all GWT permutations and optimize them -->
              <module>org.drools.guvnor.Guvnor</module>
              <draftCompile>false</draftCompile>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>soaProfile</id>
      <activation>
        <property>
          <name>soa</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin><!-- Keep in sync with full profile -->
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>gwt-maven-plugin</artifactId>
            <configuration>
              <!-- Build all GWT permutations and optimize them -->
              <module>org.drools.guvnor.Guvnor</module>
              <draftCompile>false</draftCompile>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <dependencies>
    <!-- Internal dependencies -->
    <dependency>
      <groupId>org.drools</groupId>
      <artifactId>guvnor-repository</artifactId>
    </dependency>
    <dependency>
      <groupId>org.drools</groupId>
      <artifactId>drools-compiler</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jbpm</groupId>
      <artifactId>jbpm-bpmn2</artifactId>
    </dependency>
    <dependency>
      <groupId>org.drools</groupId>
      <artifactId>drools-decisiontables</artifactId>
    </dependency>
    <dependency>
      <groupId>org.drools</groupId>
      <artifactId>drools-templates</artifactId>
    </dependency>
    <dependency>
      <groupId>org.drools</groupId>
      <artifactId>drools-verifier</artifactId>
    </dependency>
    <dependency>
      <groupId>org.drools</groupId>
      <artifactId>droolsjbpm-ide-common</artifactId>
    </dependency>
    <dependency>
      <groupId>wsdl4j</groupId>
      <artifactId>wsdl4j</artifactId>
    </dependency>

    <dependency>
      <groupId>net.sf.webdav-servlet</groupId>
      <artifactId>webdav-servlet</artifactId>
    </dependency>
    <!-- External dependencies -->
    <!-- now the deps for the web app -->
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>servlet-api</artifactId>
      <version>2.5</version>
      <scope>provided</scope><!-- Any servlet container supports  -->
    </dependency>
    <dependency>
      <groupId>pl.balon.gwt</groupId>
      <artifactId>gwt-diagrams</artifactId>
    </dependency>
    <dependency>
      <groupId>org.cobogw.gwt</groupId>
      <artifactId>cobogw</artifactId>
    </dependency>
    <dependency>
      <groupId>com.google.gwt</groupId>
      <artifactId>gwt-servlet</artifactId>
    </dependency>
    <dependency><!-- Not needed at runtime, only at compile time, should be a dependency on gwt-maven-plugin -->
      <groupId>com.google.gwt</groupId>
      <artifactId>gwt-dev</artifactId>
      <version>${gwt.version}</version>      
      <scope>provided</scope><!-- HACK to remove it from the runtime classpath -->
    </dependency>    
    <dependency><!-- Not needed at runtime, only at compile time, should be a dependency on gwt-maven-plugin -->
      <groupId>com.google.gwt</groupId>
      <artifactId>gwt-user</artifactId>
      <scope>provided</scope><!-- HACK to remove it from the runtime classpath -->
    </dependency>
    <dependency>
      <groupId>commons-fileupload</groupId>
      <artifactId>commons-fileupload</artifactId>
    </dependency>
    <dependency>
      <groupId>commons-lang</groupId>
      <artifactId>commons-lang</artifactId>
    </dependency>
    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
    </dependency>
    <dependency>
      <groupId>org.freemarker</groupId>
      <artifactId>freemarker</artifactId>
    </dependency>
    <!-- seam follows -->
    <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>jboss-seam-remoting</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>jboss-seam</artifactId>
    </dependency>
    <dependency>
      <groupId>javax.ejb</groupId>
      <artifactId>ejb-api</artifactId>
    </dependency>
    <dependency>
      <groupId>javassist</groupId>
      <artifactId>javassist</artifactId>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>javax.el</groupId>
      <artifactId>el-api</artifactId>
      <scope>provided</scope><!-- Both tomcat and jetty include this, so it's probably part of the servlet spec -->
    </dependency>
    <!-- REST dependencies -->
    <dependency>
      <groupId>javax.ws.rs</groupId>
      <artifactId>jsr311-api</artifactId>
      <version>1.1.1</version>
      <type>jar</type>
    </dependency>
    <!-- Do not change this version as this is the CXF version used by JBOSS AS 6.0 Final -->
    <dependency>
      <groupId>org.apache.cxf</groupId>
      <artifactId>cxf-rt-frontend-jaxrs</artifactId>
      <version>2.3.1</version>
      <exclusions>
        <exclusion>
          <groupId>org.apache.cxf</groupId>
          <artifactId>cxf-rt-databinding-aegis</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.eclipse.jetty</groupId>
          <artifactId>jetty-server</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.apache.geronimo.specs</groupId>
          <artifactId>geronimo-servlet_3.0_spec</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.springframework</groupId>
          <artifactId>spring-core</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.springframework</groupId>
          <artifactId>spring-web</artifactId>
        </exclusion>        
      </exclusions>
    </dependency>
    <!-- This is needed by CXF to work with JBoss AS -->
    <dependency>
        <groupId>org.apache.geronimo.specs</groupId>
        <artifactId>geronimo-annotation_1.0_spec</artifactId>
        <version>1.1.1</version>
    </dependency>  
    <dependency>
      <groupId>org.apache.cxf</groupId>
      <artifactId>cxf-testutils</artifactId>
      <!-- TODO JBRULES-3028 overwrites the droolsjbpm-parent version of 2.2.9 used by drools-camel -->
      <version>2.3.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.abdera</groupId>
      <artifactId>abdera-client</artifactId>
      <version>1.1.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.abdera</groupId>
      <artifactId>abdera-server</artifactId>
      <version>1.1.1</version>
    </dependency>
    <!-- Only needed by Tomcat deployment. Excluded by most guvnor-distribution-wars assemblies -->
    <dependency>
      <groupId>javax.transaction</groupId>
      <artifactId>jta</artifactId>
    </dependency>
    <!-- Only needed by Tomcat deployment. Excluded by most guvnor-distribution-wars assemblies -->
    <dependency>
      <groupId>javax.persistence</groupId>
      <artifactId>persistence-api</artifactId>
    </dependency>
    <!-- Only needed by Tomcat deployment. Excluded by most guvnor-distribution-wars assemblies  -->
    <dependency>
      <groupId>javax.faces</groupId>
      <artifactId>jsf-api</artifactId>
    </dependency>
    <!-- Only needed by Tomcat deployment. Excluded by most guvnor-distribution-wars assemblies  -->
    <dependency>
      <groupId>org.hibernate</groupId>
      <artifactId>hibernate-validator</artifactId>
    </dependency>
    <!-- NOT needed due to licencing -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>jcl-over-slf4j</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>commons-httpclient</groupId>
      <artifactId>commons-httpclient</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jetty</groupId>
      <artifactId>jetty-server</artifactId>
      <version>7.2.2.v20101205</version>
      <exclusions>
        <exclusion>
          <groupId>javax.servlet</groupId>
          <artifactId>servlet-api</artifactId>
        </exclusion>
      </exclusions>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jetty</groupId>
      <artifactId>jetty-webapp</artifactId>
      <version>7.2.2.v20101205</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
</project>
