<?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>
    <name>HAL Core Console :: Build</name>
    <artifactId>jboss-as-console-build</artifactId>
    <packaging>pom</packaging>
    <description>Final extension applications should inherit from this pom</description>


    <!-- Parent -->
    <parent>
        <groupId>org.jboss.as</groupId>
        <artifactId>jboss-as-console-parent</artifactId>
        <version>2.2.10.Final</version>
        <relativePath>../pom.xml</relativePath>
    </parent>


    <!--
    ~  USAGE:
    ~  Inherit from this pom.
    ~  Add maven-dependency-plugin to build.
    ~  Add dependencies for extensions.  Use "provided" scope.
    -->
    <!--  Dependencies -->
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.jboss.as</groupId>
                <artifactId>jboss-as-console-bom</artifactId>
                <type>pom</type>
                <!-- Do not replace with ${project.version} or the builds of the extensions will break! -->
                <version>2.2.10.Final</version>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>


    <dependencies>
        <dependency>
            <groupId>org.jboss.as</groupId>
            <artifactId>jboss-as-console-resources</artifactId>
            <type>war</type>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.as</groupId>
            <artifactId>jboss-as-console-dialogs</artifactId>
            <type>war</type>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.as</groupId>
            <artifactId>jboss-as-console-core</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.as</groupId>
            <artifactId>jboss-as-console-core</artifactId>
            <classifier>sources</classifier>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.google.gwt</groupId>
            <artifactId>gwt-dev</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>


    <!-- Plugins -->
    <build>
        <outputDirectory>war/WEB-INF/classes</outputDirectory>


        <pluginManagement>
            <plugins>
                <plugin>
                    <artifactId>maven-war-plugin</artifactId>
                    <executions>
                        <execution>
                            <phase>generate-resources</phase>
                            <goals>
                                <goal>exploded</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <webappDirectory>war</webappDirectory>
                        <warSourceDirectory>war</warSourceDirectory>
                        <overlays>
                            <overlay>
                                <groupId>org.jboss.as</groupId>
                                <artifactId>jboss-as-console-resources</artifactId>
                                <type>war</type>
                            </overlay>
                            <overlay>
                                <groupId>org.jboss.as</groupId>
                                <artifactId>jboss-as-console-dialogs</artifactId>
                                <type>war</type>
                            </overlay>
                        </overlays>
                        <packagingExcludes>**/*.*</packagingExcludes>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>


        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-clean-plugin</artifactId>
                <configuration>
                    <filesets>
                        <fileset>
                            <directory>war</directory>
                            <includes>
                                <include>**/*.*</include>
                            </includes>
                        </fileset>
                        <fileset>
                            <directory>gwt-unitCache</directory>
                        </fileset>
                    </filesets>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>gwt-maven-plugin</artifactId>
                <configuration>
                    <inplace>true</inplace>
                    <logLevel>INFO</logLevel>
                    <runTarget>App.html</runTarget>
                    <warSourceDirectory>war</warSourceDirectory>
                    <extraJvmArgs>-Xmx1024m -DDEBUG -XX:MaxPermSize=512M</extraJvmArgs>
                    <style>OBF</style>
                    <hostedWebapp>war</hostedWebapp>
                    <localWorkers>4</localWorkers>
                    <compileReport>false</compileReport>
                    <module>org.jboss.as.console.composite.App_WF</module>
                    <disableCastChecking>true</disableCastChecking>
                    <disableClassMetadata>true</disableClassMetadata>
                    <enableClosureCompiler>true</enableClosureCompiler>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.bsc.maven</groupId>
                <artifactId>maven-processor-plugin</artifactId>
                <executions>
                    <execution>
                        <id>process-spi</id>
                        <goals>
                            <goal>process</goal>
                        </goals>
                        <phase>generate-sources</phase>
                        <configuration>
                            <outputDiagnostics>true</outputDiagnostics>
                            <addCompileSourceRoots>false</addCompileSourceRoots>
                            <appendSourceArtifacts>true</appendSourceArtifacts>
                            <processors>
                                <processor>org.jboss.as.console.spi.SPIProcessor</processor>
                            </processors>
                            <options>
                                <!--
                                    All properties prefixed with 'gwt' are written into the
                                    generated GWT module (without the 'gwt.' prefix)
                                -->
                                <gwt.console.core.version>${project.version}</gwt.console.core.version>
                                <gwt.console.dev.host>${gwt.bindAddress}</gwt.console.dev.host>
                                <gwt.console.dev.port>${gwt.bindPort}</gwt.console.dev.port>
                            </options>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <classesDirectory>war</classesDirectory>
                    <excludes>
                        <exclude>WEB-INF/**</exclude>
                    </excludes>
                    <classifier>resources</classifier>
                </configuration>
            </plugin>
        </plugins>
    </build>


    <profiles>
        <profile>
            <id>default-properties</id>
            <properties>
                <env>default</env>
            </properties>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
        </profile>


        <profile>
            <!-- Develop profile for quick turnaround times -->
            <id>dev</id>
            <properties>
                <skipTests>true</skipTests>
                <o>true</o> <!-- offline -->
                <env>default</env>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>gwt-maven-plugin</artifactId>
                        <configuration>
                            <module>org.jboss.as.console.composite.App_WF_dev</module>
                            <!--style>DETAILED</style>
                            <enableClosureCompiler>false</enableClosureCompiler-->
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <skipTests>true</skipTests>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>


        <profile>
            <!-- Full community profile with all languages and browsers -->
            <id>full</id>
            <properties>
                <env>default</env>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>gwt-maven-plugin</artifactId>
                        <configuration>
                            <disableCastChecking>true</disableCastChecking>
                            <disableClassMetadata>true</disableClassMetadata>
                            <module>org.jboss.as.console.composite.App_WF_full</module>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-jar-plugin</artifactId>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <classesDirectory>war</classesDirectory>
                            <excludes>
                                <exclude>WEB-INF/**</exclude>
                            </excludes>
                            <classifier>full-resources</classifier>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>


        <profile>
            <!-- Red Hat look & feel -->
            <id>eap</id>
            <properties>
                <env>default</env>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>gwt-maven-plugin</artifactId>
                        <configuration>
                            <disableCastChecking>true</disableCastChecking>
                            <disableClassMetadata>true</disableClassMetadata>
                            <module>org.jboss.as.console.composite.App_RH</module>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>


        <profile>
            <id>eapdev</id>
            <properties>
                <skipTests>true</skipTests>
                <o>true</o> <!-- offline -->
                <env>default</env>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>gwt-maven-plugin</artifactId>
                        <configuration>
                            <module>org.jboss.as.console.composite.App_RH_dev</module>
                            <style>DETAILED</style>
                            <enableClosureCompiler>false</enableClosureCompiler>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <skipTests>true</skipTests>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>compile-report</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>gwt-maven-plugin</artifactId>
                        <configuration>
                            <compileReport>true</compileReport>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
            <reporting>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>gwt-maven-plugin</artifactId>
                        <reportSets>
                            <reportSet>
                                <reports>
                                    <report>compile-report</report>
                                </reports>
                            </reportSet>
                        </reportSets>
                    </plugin>
                </plugins>
            </reporting>
        </profile>


        <profile>
            <id>xxl</id>
            <properties>
                <skipTests>true</skipTests>
                <env>default</env>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>gwt-maven-plugin</artifactId>
                        <configuration>
                            <extraJvmArgs>-Xmx1024m -XX:MaxPermSize=256M</extraJvmArgs>
                            <localWorkers>6</localWorkers>
                        </configuration>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>compile</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
