<?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">

  <!-- POM file generated with GWT webAppCreator -->
  <parent>
    <artifactId>switchyard-console-parent</artifactId>
    <groupId>org.switchyard</groupId>
    <version>0.2.0</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.switchyard</groupId>
  <artifactId>switchyard-console-gwt</artifactId>
  <packaging>war</packaging>
  <version>0.2.0</version>
  <name>SwitchYard: Management Console Application</name>
  <description>Management console application for SwitchYard</description>

  <properties>
    <webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
    <gwt.plugin.version>${gwt.version}</gwt.plugin.version>
    <asConsoleIncludesDirectory>${project.build.directory}/dependency/as-console</asConsoleIncludesDirectory>
  </properties>

  <dependencies>
    <!-- <dependency> <groupId>org.jboss.as</groupId> <artifactId>jboss-as-console</artifactId> <version>1.0.0.Beta9</version> 
      <type>java-source</type> <classifier>sources</classifier> </dependency> -->

    <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>
    <dependency>
      <groupId>com.google.code.gwt-log</groupId>
      <artifactId>gwt-log</artifactId>
    </dependency>
    <dependency>
      <groupId>com.gwtplatform</groupId>
      <artifactId>gwtp-all</artifactId>
      <exclusions>
        <exclusion>
          <groupId>org.springframework</groupId>
          <artifactId>spring-core</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.springframework</groupId>
          <artifactId>spring-context</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.springframework</groupId>
          <artifactId>spring-beans</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.springframework</groupId>
          <artifactId>spring-web</artifactId>
        </exclusion>
        <exclusion>
          <groupId>net.sourceforge.htmlunit</groupId>
          <artifactId>crawl_htmlunit</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>com.google.inject</groupId>
      <artifactId>guice</artifactId>
    </dependency>
    <dependency>
      <groupId>com.google.gwt.inject</groupId>
      <artifactId>gin</artifactId>
    </dependency>
    <dependency>
      <groupId>com.mycila.com.google.inject.extensions</groupId>
      <artifactId>guice-assisted-inject</artifactId>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.google.gwt</groupId>
      <artifactId>gwt-dev</artifactId>
      <type>jar</type>
      <scope>test</scope>
    </dependency>

    <!-- managment api -->
    <dependency>
    	<groupId>org.jboss</groupId>
    	<artifactId>jboss-dmr</artifactId>
    	<version>1.0.0.Final</version>
    	<type>jar</type>
    	<scope>provided</scope>
    </dependency>
    <dependency>
    	<groupId>org.jboss.as</groupId>
    	<artifactId>jboss-as-controller-client</artifactId>
    	<version>7.0.0.Final</version>
    	<type>jar</type>
    	<scope>provided</scope>
    </dependency>
  </dependencies>

  <build>
    <!-- Generate compiled stuff in the folder used for developing mode -->
    <outputDirectory>${webappDirectory}/WEB-INF/classes</outputDirectory>

    <plugins>

      <!-- Dependencies from JBoss AS 7 Console -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>unpack-jboss-as-sources</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>unpack</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>org.jboss.as</groupId>
                  <artifactId>jboss-as-console</artifactId>
                  <version>1.0.0.Beta13</version>
                  <classifier>sources</classifier>
                  <type>jar</type>
                  <includes>org/jboss/dmr/**,org/jboss/as/console/client/widgets/**,org/jboss/as/console/client/auth/**,org/jboss/as/console/client/core/*.*,org/jboss/as/console/client/core/message/*.*,org/jboss/as/console/client/shared/*.*,org/jboss/as/console/client/shared/dispatch/**,org/jboss/as/console/client/Build.java,gwt-proxy.properties</includes>
                  <excludes>org/jboss/as/console/client/shared/BeanFactory.java</excludes>
                  <outputDirectory>${asConsoleIncludesDirectory}/java</outputDirectory>
                </artifactItem>
              </artifactItems>
            </configuration>
          </execution>
          <execution>
            <id>unpack-jboss-as-resources</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>unpack</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>org.jboss.as</groupId>
                  <artifactId>jboss-as-console</artifactId>
                  <version>1.0.0.Beta13</version>
                  <classifier>resources</classifier>
                  <type>jar</type>
                  <includes>images/**,*.css</includes>
                  <outputDirectory>${webappDirectory}</outputDirectory>
                </artifactItem>
              </artifactItems>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <!-- Add JBoss AS 7 Console source to build path -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>1.5</version>
        <executions>
          <execution>
            <id>add-source</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>add-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>${asConsoleIncludesDirectory}/java</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>1.6</source>
          <target>1.6</target>
        </configuration>
      </plugin>

      <!-- GWT Maven Plugin -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>gwt-maven-plugin</artifactId>
        <version>${gwt.plugin.version}</version>
        <executions>
          <execution>
            <goals>
              <goal>resources</goal>
              <goal>compile</goal>
              <goal>test</goal>
              <goal>i18n</goal>
            </goals>
          </execution>
        </executions>
        <!-- Plugin configuration. There are many available options, see gwt-maven-plugin documentation at codehaus.org -->
        <configuration>
          <compileReport>false</compileReport>
          <hostedWebapp>${webappDirectory}</hostedWebapp>
          <htmlunit>FF3,IE7</htmlunit>
          <i18nMessagesBundle>org.switchyard.console.client.Messages</i18nMessagesBundle>
          <logLevel>TRACE</logLevel>
          <mode>htmlunit</mode>
          <runTarget>SwitchYard.html</runTarget>
        </configuration>
      </plugin>

      <!-- Copy static web files before executing gwt:run -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.1.1</version>
        <executions>
          <execution>
            <phase>compile</phase>
            <goals>
              <goal>exploded</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <!-- Remove GWT tests -->
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <excludes>
            <exclude>**/GwtTest*.java</exclude>
          </excludes>
        </configuration>
      </plugin>
    </plugins>
  </build>

</project>
