<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2015-2016 Red Hat, Inc, and individual contributors.
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~ https://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.jboss</groupId>
        <artifactId>jboss-parent</artifactId>
        <version>35</version>
    </parent>

    <groupId>org.jboss.hal</groupId>
    <artifactId>hal-parent</artifactId>
    <version>3.2.7.Final</version>
    <name>HAL :: Parent :: Aggregator</name>
    <description>The WildFly / EAP management console</description>
    <packaging>pom</packaging>
    <url>https://hal.github.io/</url>

    <organization>
        <name>JBoss, a division of Red Hat</name>
        <url>https://developer.jboss.org/</url>
    </organization>

    <developers>
        <developer>
            <name>Harald Pehl</name>
            <id>hpehl</id>
            <email>hpehl@redhat.com</email>
            <organization>Red Hat</organization>
            <timezone>+1</timezone>
            <roles>
                <role>Lead</role>
            </roles>
        </developer>
        <developer>
            <name>Claudio Miranda</name>
            <id>claudio4j</id>
            <email>claudio@redhat.com</email>
            <organization>Red Hat</organization>
            <timezone>-3</timezone>
        </developer>
    </developers>

    <licenses>
        <license>
            <name>Apache License 2.0</name>
            <url>https://repository.jboss.org/licenses/apache-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
        <license>
            <name>MIT License</name>
            <url>https://repository.jboss.org/licenses/mit.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <scm>
        <connection>scm:git@github.com:hal/console.git</connection>
        <developerConnection>scm:git:git@github.com:hal/console.git</developerConnection>
        <url>git@github.com:hal/console.git</url>
    </scm>

    <issueManagement>
        <system>jira</system>
        <url>https://issues.jboss.org/browse/HAL</url>
    </issueManagement>

    <properties>
        <github.global.server>github</github.global.server>
        <grunt-task>dev</grunt-task>
        <gwt.draftCompile>true</gwt.draftCompile>
        <gwt.failOnError>true</gwt.failOnError>
        <gwt.logLevel>FINE</gwt.logLevel>
        <gwt.moduleTemplate>${project.basedir}/src/main/module.gwt.xml</gwt.moduleTemplate>
        <gwt.optimize>0</gwt.optimize>
        <gwt.style>DETAILED</gwt.style>
        <gwt.devmode.hostname>0.0.0.0</gwt.devmode.hostname>
        <hal.version>${project.version}</hal.version>

        <linkXRef>false</linkXRef>
        <maven.compiler.target>1.8</maven.compiler.target>
        <maven.compiler.source>1.8</maven.compiler.source>

        <plugin.buildhelper.version>3.0.0</plugin.buildhelper.version>
        <plugin.degraph.version>3.0.1</plugin.degraph.version>
        <plugin.docker.version>0.30.0</plugin.docker.version>
        <plugin.download.version>1.3.0</plugin.download.version>
        <plugin.frontend.version>1.6</plugin.frontend.version>
        <plugin.gwt.version>1.0-rc-9</plugin.gwt.version>
        <plugin.processor.version>3.3.2</plugin.processor.version>
        <plugin.reports.version>2.9</plugin.reports.version>
        <plugin.github.site.version>0.12</plugin.github.site.version>
        <plugin.swarm.version>60</plugin.swarm.version>

        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

        <theme.name>hal</theme.name>
    </properties>

    <modules>
        <module>app</module>
        <module>ballroom</module>
        <module>bom</module>
        <module>core</module>
        <module>config</module>
        <module>db</module>
        <module>dmr</module>
        <module>flow</module>
        <module>js</module>
        <module>meta</module>
        <module>parent-with-dependencies</module>
        <module>parent-with-gwt</module>
        <module>processors</module>
        <module>resources</module>
        <module>spi</module>
        <module>standalone</module>
        <module>themes</module>
        <module>testsuite</module>
    </modules>

    <build>
        <pluginManagement>
            <!-- plugins ordered by artifactId -->
            <plugins>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>build-helper-maven-plugin</artifactId>
                    <version>${plugin.buildhelper.version}</version>
                </plugin>
                <plugin>
                    <groupId>com.github.ferstl</groupId>
                    <artifactId>depgraph-maven-plugin</artifactId>
                    <version>${plugin.degraph.version}</version>
                </plugin>
                <plugin>
                    <groupId>io.fabric8</groupId>
                    <artifactId>docker-maven-plugin</artifactId>
                    <version>${plugin.docker.version}</version>
                </plugin>
                <plugin>
                    <groupId>com.github.eirslett</groupId>
                    <artifactId>frontend-maven-plugin</artifactId>
                    <version>${plugin.frontend.version}</version>
                </plugin>
                <plugin>
                    <groupId>net.ltgt.gwt.maven</groupId>
                    <artifactId>gwt-maven-plugin</artifactId>
                    <version>${plugin.gwt.version}</version>
                    <extensions>true</extensions>
                </plugin>
                <plugin>
                    <groupId>org.wildfly.swarm</groupId>
                    <artifactId>wildfly-swarm-fraction-plugin</artifactId>
                    <version>${plugin.swarm.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>com.github.ferstl</groupId>
                <artifactId>depgraph-maven-plugin</artifactId>
                <configuration>
                    <createImage>true</createImage>
                    <customStyleConfiguration>build/degraph-style.json</customStyleConfiguration>
                    <includes>
                        <include>org.jboss.hal:hal-console</include>
                        <include>org.jboss.hal:hal-ballroom</include>
                        <include>org.jboss.hal:hal-config</include>
                        <include>org.jboss.hal:hal-core</include>
                        <include>org.jboss.hal:hal-db</include>
                        <include>org.jboss.hal:hal-dmr</include>
                        <include>org.jboss.hal:hal-flow</include>
                        <include>org.jboss.hal:hal-js</include>
                        <include>org.jboss.hal:hal-meta</include>
                        <include>org.jboss.hal:hal-resources</include>
                        <include>org.jboss.hal:hal-spi</include>
                        <include>com.google.elemental2:*</include>
                        <include>com.google.gwt:gwt-user</include>
                        <include>com.google.guava:guava</include>
                        <include>com.gwtplatform:gwtp-all</include>
                        <include>com.intendia.gwt.rxgwt:rxgwt</include>
                        <include>org.jboss.gwt.elemento:elemento-core</include>
                        <include>org.jboss.gwt.elemento:elemento-template-api</include>
                        <include>org.slf4j:slf4j-api</include>
                    </includes>
                    <mergeTypes>true</mergeTypes>
                    <scope>compile</scope>
                    <showGroupIds>true</showGroupIds>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <executions>
                    <execution>
                        <id>checkstyle</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <configuration>
                            <configLocation>build/checkstyle.xml</configLocation>
                            <encoding>UTF-8</encoding>
                            <consoleOutput>true</consoleOutput>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <executions>
                    <execution>
                        <id>unit-tests</id>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <phase>test</phase>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>docker</id>
            <modules>
                <module>docker</module>
            </modules>
        </profile>
        <profile>
            <id>i18n</id>
            <properties>
                <gwt.module>${project.basedir}/src/main/module-i18n.gwt.xml</gwt.module>
            </properties>
        </profile>
        <profile>
            <id>npm</id>
            <modules>
                <module>npm</module>
            </modules>
        </profile>
        <profile>
            <id>prod</id>
            <properties>
                <gwt.draftCompile>false</gwt.draftCompile>
                <!--
                    Do not optimize: It will wipe out code which actually must not be erased.
                    TODO Check if this is a bug in GWT or how much we can optimize until the code is removed.
                -->
                <gwt.logLevel>INFO</gwt.logLevel>
                <gwt.optimize>0</gwt.optimize>
                <gwt.style>OBFUSCATED</gwt.style>
                <grunt-task>prod</grunt-task>
            </properties>
        </profile>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-enforcer-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>enforce-no-snapshots</id>
                                <goals>
                                    <goal>enforce</goal>
                                </goals>
                                <configuration>
                                    <rules>
                                        <requireReleaseDeps>
                                            <message>No Snapshots Allowed!</message>
                                        </requireReleaseDeps>
                                    </rules>
                                    <fail>true</fail>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>theme-eap</id>
            <properties>
                <theme.name>eap</theme.name>
            </properties>
        </profile>
        <profile>
            <id>theme-hal</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                <theme.name>hal</theme.name>
            </properties>
        </profile>
        <profile>
            <id>theme-wildfly</id>
            <properties>
                <theme.name>wildfly</theme.name>
            </properties>
        </profile>
    </profiles>

    <repositories>
        <repository>
            <id>sonatype-snapshots</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
            <releases>
                <enabled>false</enabled>
            </releases>
        </repository>
        <repository>
            <id>google-snapshots</id>
            <url>https://oss.sonatype.org/content/repositories/google-snapshots/</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
            <releases>
                <enabled>false</enabled>
            </releases>
        </repository>
        <repository>
            <id>jboss-nexus</id>
            <url>https://repository.jboss.org/nexus/content/groups/public</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <releases>
                <enabled>true</enabled>
            </releases>
        </repository>
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>sonatype-plugins</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
            <releases>
                <enabled>false</enabled>
            </releases>
        </pluginRepository>
    </pluginRepositories>
</project>
