<?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.7.2.Final</version>
        <relativePath>../bom/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.7.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>
            <version>${circuit.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.gwt.circuit</groupId>
            <artifactId>circuit-core</artifactId>
            <classifier>sources</classifier>
            <version>${circuit.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.gwt.circuit</groupId>
            <artifactId>circuit-meta</artifactId>
            <version>${circuit.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.gwt.circuit</groupId>
            <artifactId>circuit-meta</artifactId>
            <version>${circuit.version}</version>
            <classifier>sources</classifier>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jgrapht</groupId>
            <artifactId>jgrapht-core</artifactId>
            <version>${jgrapht.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jgrapht</groupId>
            <artifactId>jgrapht-core</artifactId>
            <classifier>sources</classifier>
            <version>${jgrapht.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.hal</groupId>
            <artifactId>redhat-support-plugin</artifactId>
            <classifier>resources</classifier>
            <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>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.hal</groupId>
                                <artifactId>redhat-support-plugin</artifactId>
                                <type>jar</type>
                                <classifier>resources</classifier>
                            </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.bsc.maven</groupId>
                <artifactId>maven-processor-plugin</artifactId>
                <executions>
                    <execution>
                        <id>generate-gwt-modules</id>
                        <goals>
                            <goal>process</goal>
                        </goals>
                        <phase>generate-sources</phase>
                        <configuration>
                            <processors>
                                <processor>org.jboss.hal.processors.GwtModuleProcessor</processor>
                            </processors>
                            <processSourceArtifacts>
                                <processSourceArtifact>org.jboss.as:jboss-as-console-core</processSourceArtifact>
                            </processSourceArtifacts>
                            <defaultOutputDirectory>${project.build.directory}/generated-sources/annotations</defaultOutputDirectory>
                            <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>
                        </configuration>
                    </execution>
                </executions>
            </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>
                    <extraJvmArgs>-Xmx1024m -DDEBUG</extraJvmArgs>
                    <style>OBF</style>
                    <hostedWebapp>war</hostedWebapp>
                    <sourceLevel>1.8</sourceLevel>
                    <localWorkers>4</localWorkers>
                    <compileReport>false</compileReport>
                    <module>org.jboss.as.console.composite.WildFly</module>
                    <disableCastChecking>true</disableCastChecking>
                    <disableClassMetadata>true</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>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>gwt-maven-plugin</artifactId>
                        <configuration>
                            <module>org.jboss.as.console.composite.WildFlyDev</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.WildFlyFull</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.EAP</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.EAPDev</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>
