<?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.mule.ibeans</groupId>
        <artifactId>mule-ibeans</artifactId>
        <version>1.0</version>
    </parent>

    <groupId>org.mule.ibeans</groupId>
    <artifactId>ibeans-console</artifactId>
    <packaging>war</packaging>
    <name>Mule iBeans Console</name>

    <properties>
        <gwtVersion>1.7.1</gwtVersion>
    </properties>

    <build>
        <finalName>ibeans</finalName>
        <plugins>
            <plugin>
                <groupId>com.totsp.gwt</groupId>
                <artifactId>maven-googlewebtoolkit2-plugin</artifactId>
                <configuration>
                    <compileTargets>
                        <value>ibeans.Console</value>
                    </compileTargets>
                    <runTarget>ibeans.Console/index.html</runTarget>
                    <logLevel>INFO</logLevel>
                    <style>DETAILED</style>
                    <noServer>false</noServer>
                    <extraJvmArgs>-Xss1024k -Xmx1024m -Dgwt.nowarn.legacy.tools</extraJvmArgs>
                    <gwtVersion>${gwtVersion}</gwtVersion>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>mergewebxml</goal>
                            <!--<goal>i18n</goal>-->
                            <goal>compile</goal>
                            <!-- <goal>test</goal>-->
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <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>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <configuration>
                    <warSourceExcludes>.gwt-tmp/**</warSourceExcludes>
                    <webappDirectory>${project.build.directory}/${project.build.finalName}/ibeans.Console/
                    </webappDirectory>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>org.mule.ibeans</groupId>
            <artifactId>ibeanscentral-ibean</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>com.extjs</groupId>
            <artifactId>gxt</artifactId>
            <version>2.0.1</version>
        </dependency>

        <dependency>
            <groupId>com.google.gwt</groupId>
            <artifactId>gwt-servlet</artifactId>
            <version>${gwtVersion}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.google.gwt</groupId>
            <artifactId>gwt-user</artifactId>
            <version>${gwtVersion}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.google.gwt</groupId>
            <artifactId>gwt-dev</artifactId>
            <version>${gwtVersion}</version>
            <classifier>${platform}-libs</classifier>
            <type>zip</type>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.google.gwt</groupId>
            <artifactId>gwt-dev</artifactId>
            <version>${gwtVersion}</version>
            <classifier>${platform}</classifier>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.ibeans</groupId>
            <artifactId>ibeans-ri</artifactId>
            <version>${project.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.ibeans</groupId>
            <artifactId>ibeans-module-feeds</artifactId>
            <version>${project.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.ibeans</groupId>
            <artifactId>ibeans-module-http</artifactId>
            <version>${project.version}</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <profiles>
        <profile>
            <id>gwt-dev-windows</id>
            <activation>
                <activeByDefault>false</activeByDefault>
                <os>
                    <family>windows</family>
                </os>
            </activation>
            <properties>
                <platform>windows</platform>
            </properties>
        </profile>
        <profile>
            <id>gwt-dev-mac</id>
            <activation>
                <activeByDefault>true</activeByDefault>
                <os>
                    <family>mac</family>
                </os>
            </activation>
            <properties>
                <platform>mac</platform>
            </properties>
        </profile>
        <profile>
            <id>gwt-dev-linux</id>
            <activation>
                <activeByDefault>false</activeByDefault>
                <os>
                    <name>linux</name>
                </os>
            </activation>
            <properties>
                <platform>linux</platform>
            </properties>
        </profile>
    </profiles>

    <repositories>
        <repository>
            <id>gwt-maven</id>
            <url>http://dist.codehaus.org/mule/dependencies/maven2/</url>
        </repository>
        <repository>
            <id>gwt-maven2</id>
            <url>http://gwt-maven.googlecode.com/svn/trunk/mavenrepo</url>
        </repository>
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>gwt-maven</id>
            <url>http://dist.codehaus.org/mule/dependencies/maven2/</url>
        </pluginRepository>
        <pluginRepository>
            <id>gwt-maven2</id>
            <url>http://gwt-maven.googlecode.com/svn/trunk/mavenrepo</url>
        </pluginRepository>
    </pluginRepositories>
</project>
