<?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-bom</artifactId>
        <version>2.9.2.Final</version>
        <relativePath>../bom/pom.xml</relativePath>
    </parent>

    <properties>
        <gwt.module>org.jboss.as.console.composite.WildFly</gwt.module>
    </properties>

    <!--
    ~  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.9.2.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-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>org.jboss.as</groupId>
            <artifactId>hal-processors</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.gwt.circuit</groupId>
            <artifactId>circuit-core</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.gwt.circuit</groupId>
            <artifactId>circuit-core</artifactId>
            <classifier>sources</classifier>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.gwt.circuit</groupId>
            <artifactId>circuit-meta</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.gwt.circuit</groupId>
            <artifactId>circuit-meta</artifactId>
            <classifier>sources</classifier>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jgrapht</groupId>
            <artifactId>jgrapht-core</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jgrapht</groupId>
            <artifactId>jgrapht-core</artifactId>
            <classifier>sources</classifier>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.hal</groupId>
            <artifactId>hal-guided-tour</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.enterprise</groupId>
            <artifactId>cdi-api</artifactId>
            <version>1.2</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.google.gwt</groupId>
            <artifactId>gwt-dev</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava-gwt</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.google.j2objc</groupId>
            <artifactId>j2objc-annotations</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>
                    <groupId>org.bsc.maven</groupId>
                    <artifactId>maven-processor-plugin</artifactId>
                    <version>${version.maven.processor.plugin}</version>
                    <executions>
                        <execution>
                            <id>process-spi</id>
                            <goals>
                                <goal>process</goal>
                            </goals>
                            <phase>generate-sources</phase>
                            <configuration>
                                <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>
                                    <!-- Uncomment to get more messages from the annotation processors -->
                                    <!--<debug>true</debug>-->
                                </options>
                                <processSourceArtifacts>
                                    <processSourceArtifact>org.jboss.as:jboss-as-console-core:sources</processSourceArtifact>
                                </processSourceArtifacts>
                                <defaultOutputDirectory>${project.build.directory}/generated-sources/annotations</defaultOutputDirectory>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <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.hal</groupId>
                                <artifactId>hal-guided-tour</artifactId>
                                <type>jar</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.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <compilerArgument>-proc:none</compilerArgument>
                </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>
                    <jsInteropMode>JS</jsInteropMode>
                    <extraJvmArgs>-Xms768m -Xmx2024m -Xss1024k -Dgwt.jjs.permutationWorkerFactory=com.google.gwt.dev.ThreadedPermutationWorkerFactory -DDEBUG</extraJvmArgs>
                    <style>OBF</style>
                    <bindAddress>${gwt.bindAddress}</bindAddress>
                    <hostedWebapp>war</hostedWebapp>
                    <sourceLevel>1.8</sourceLevel>
                    <localWorkers>2</localWorkers>
                    <compileReport>false</compileReport>
                    <module>${gwt.module}</module>
                    <disableCastChecking>true</disableCastChecking>
                    <disableClassMetadata>false</disableClassMetadata>
                    <enableClosureCompiler>true</enableClosureCompiler>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                    </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>
                <gwt.module>org.jboss.as.console.composite.WildFlyDev</gwt.module>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>gwt-maven-plugin</artifactId>
                        <configuration>
                            <module>${gwt.module}</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>
                <gwt.module>org.jboss.as.console.composite.WildFlyFull</gwt.module>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>gwt-maven-plugin</artifactId>
                        <configuration>
                            <extraJvmArgs>-Xmx3072m</extraJvmArgs>
                            <disableCastChecking>true</disableCastChecking>
                            <disableClassMetadata>false</disableClassMetadata>
                            <module>${gwt.module}</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>
                <gwt.module>org.jboss.as.console.composite.EAP</gwt.module>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>gwt-maven-plugin</artifactId>
                        <configuration>
                            <extraJvmArgs>-Xms1024m -Xmx1536m -Xss1024k -Dgwt.jjs.permutationWorkerFactory=com.google.gwt.dev.ThreadedPermutationWorkerFactory</extraJvmArgs>
                            <localWorkers>1</localWorkers>
                            <disableCastChecking>true</disableCastChecking>
                            <disableClassMetadata>false</disableClassMetadata>
                            <module>${gwt.module}</module>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>eapdev</id>
            <properties>
                <skipTests>true</skipTests>
                <o>true</o>
                <!-- offline -->
                <env>default</env>
                <gwt.module>org.jboss.as.console.composite.EAPDev</gwt.module>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>gwt-maven-plugin</artifactId>
                        <configuration>
                            <extraJvmArgs>-Xms1024m -Xmx1536m -Xss1024k -Dgwt.jjs.permutationWorkerFactory=com.google.gwt.dev.ThreadedPermutationWorkerFactory</extraJvmArgs>
                            <!--<style>DETAILED</style>-->
                            <enableClosureCompiler>false</enableClosureCompiler>
                            <module>${gwt.module}</module>
                        </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>-Xms768m -Xmx768m -XX:MaxPermSize=256M</extraJvmArgs>
                            <localWorkers>6</localWorkers>
                        </configuration>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>compile</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
