<?xml version="1.0" encoding="UTF-8"?>
<project>
   <modelVersion>4.0.0</modelVersion>
   <name>JBoss jBPM3 - GWT Console (WAR)</name>
   <groupId>org.jbpm.jbpm3</groupId>
   <artifactId>gwt-console</artifactId>
   <packaging>war</packaging>

   <!-- Parent -->
   <parent>
      <groupId>org.jbpm.jbpm3</groupId>
      <artifactId>gwt-console-parent</artifactId>
      <version>1.0.0.Beta2</version>
      <relativePath>../pom.xml</relativePath>
   </parent>

   <properties>
      <gwt-maven.version>2.0-beta24</gwt-maven.version>
   </properties>
   
   <!--  Dependencies -->
   <dependencies>

      <dependency>
         <groupId>org.jbpm.jbpm3</groupId>
         <artifactId>gwt-console-rpc</artifactId>
         <version>${version}</version>
      </dependency>

      <dependency>
         <groupId>com.google.gwt</groupId>
         <artifactId>gwt-servlet</artifactId>
         <version>${gwt.version}</version>
         <scope>runtime</scope>
      </dependency>
      <dependency>
         <groupId>com.google.gwt</groupId>
         <artifactId>gwt-user</artifactId>
         <version>${gwt.version}</version>
         <scope>provided</scope>
      </dependency>
      <dependency>
         <groupId>com.google.gwt</groupId>
         <artifactId>gwt-dev</artifactId>
         <version>${gwt.version}</version>
         <classifier>${platform}-libs</classifier>
         <type>zip</type>
         <scope>provided</scope>
      </dependency>
      <dependency>
         <groupId>com.google.gwt</groupId>
         <artifactId>gwt-dev</artifactId>
         <version>${gwt.version}</version>
         <classifier>${platform}</classifier>
         <scope>provided</scope>
      </dependency>
      <dependency>
         <groupId>com.gwtext</groupId>
         <artifactId>gwtext</artifactId>
      </dependency>
      <dependency>
         <groupId>com.google.code.gwt-log</groupId>
         <artifactId>gwt-log</artifactId>
      </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>
   </dependencies>

   <!-- Plugins -->
   <build>
      <finalName>gwt-console</finalName>
      <plugins>
         <plugin>
            <groupId>com.totsp.gwt</groupId>
            <artifactId>maven-googlewebtoolkit2-plugin</artifactId>
            <version>${gwt-maven.version}</version>
            <configuration>
               <logLevel>INFO</logLevel>
               <compileTargets>
                  <value>org.jboss.bpm.console.Application</value>
               </compileTargets>
               <runTarget>org.jboss.bpm.console.Application/Application.html</runTarget>
               <style>DETAILED</style>
               <noServer>false</noServer>
               <extraJvmArgs>-Xmx256M -Xms256M</extraJvmArgs>
               <!--  this parameter is VERY important with automatic mode -
                     has to match the version in your declared deps
                     if this is set incorrect, or left out and default does not match
                     (default is 1.5.2 for 2.0-beta23) you will have mysterious errors
               -->
               <gwtVersion>${gwt.version}</gwtVersion>
            </configuration>
            <executions>
               <execution>
                  <goals>
                     <goal>mergewebxml</goal>
                     <goal>compile</goal>
                     <goal>gwt</goal>

                     <!--
                        GWT tests are executed through "-Palltests"
                     -->
                     <!--goal>test</goal-->
                  </goals>
               </execution>
            </executions>
         </plugin>
         <!--  Use the dependency plugin to unpack gwt-dev-PLATFORM-libs.zip -->
         <!--
            (this is a replacement for the old "automatic" mode - useful if you
            don't have GWT installed already, or you just want a maven way to
            handle gwt deps)
         -->
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
               <execution>
                  <id>unpack</id>
                  <phase>compile</phase>
                  <goals>
                     <goal>unpack</goal>
                  </goals>
                  <configuration>
                     <artifactItems>
                        <artifactItem>
                           <groupId>com.google.gwt</groupId>
                           <artifactId>gwt-dev</artifactId>
                           <version>${gwtVersion}</version>
                           <classifier>${platform}-libs</classifier>
                           <type>zip</type>
                           <overWrite>false</overWrite>
                           <outputDirectory>${settings.localRepository}/com/google/gwt/gwt-dev/${gwtVersion}</outputDirectory>
                        </artifactItem>
                     </artifactItems>
                  </configuration>
               </execution>
            </executions>
         </plugin>
         <!--
            If you want to use the target/web.xml file mergewebxml produces,
            tell the war plugin to use it
         -->
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <configuration>
               <webXml>target/web.xml</webXml>
               <warSourceExcludes>.gwt-tmp/**</warSourceExcludes>
            </configuration>
         </plugin>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
               <source>1.5</source>
               <target>1.5</target>
            </configuration>
         </plugin>
      </plugins>
   </build>

   <!--  profiles (with activation per platform) -->
   <profiles>
      <profile>
         <id>gwt-dev-windows</id>
         <properties>
            <platform>windows</platform>
         </properties>
         <activation>
            <activeByDefault>true</activeByDefault>
            <os>
               <family>windows</family>
            </os>
         </activation>
      </profile>
      <profile>
         <id>gwt-dev-mac</id>
         <properties>
            <platform>mac</platform>
         </properties>
         <activation>
            <activeByDefault>false</activeByDefault>
            <os>
               <family>mac</family>
            </os>
         </activation>
      </profile>
      <profile>
         <id>gwt-dev-linux</id>
         <properties>
            <platform>linux</platform>
         </properties>
         <activation>
            <activeByDefault>false</activeByDefault>
            <os>
               <name>linux</name>
            </os>
         </activation>
      </profile>

      <!--profile>
         <id>alltests</id>
         <build>
         <plugins>
            <plugin>
               <groupId>com.totsp.gwt</groupId>
               <artifactId>maven-googlewebtoolkit2-plugin</artifactId>
               <version>${gwt-maven.version}</version>
               <executions>
                  <execution>
                     <goals>
                        <goal>mergewebxml</goal>
                        <goal>compile</goal>
                        <goal>gwt</goal>
                        <goal>test</goal>
                     </goals>
                  </execution>
               </executions>
            </plugin>
         </plugins>
         </build>
      </profile-->
   </profiles>
</project>
