<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ 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
  ~
  ~ http://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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

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

    <groupId>org.jboss.gwt.elemento</groupId>
    <artifactId>elemento-parent</artifactId>
    <version>0.6.2</version>
    <name>Elemento :: Parent</name>
    <description>Elemento brings HTML templates and other goodies to GWT Elemental</description>
    <url>http://github.com/hal/elemento</url>
    <packaging>pom</packaging>

    <licenses>
        <license>
            <name>Apache License 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Harald Pehl</name>
            <id>hpehl</id>
            <email>hpehl@redhat.com</email>
            <organization>Red Hat</organization>
            <timezone>+1</timezone>
        </developer>
        <developer>
            <name>Claudio Miranda</name>
            <id>claudio4j</id>
            <email>claudio@redhat.com</email>
            <organization>Red Hat</organization>
            <timezone>-3</timezone>
        </developer>
        <developer>
            <name>Ignacio Baca Moreno-Torres</name>
            <id>ibaca</id>
            <email>ignacio@bacamt.com</email>
            <timezone>+1</timezone>
        </developer>
    </developers>

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

    <issueManagement>
        <system>GitHub</system>
        <url>https://github.com/hal/elemento/issues</url>
    </issueManagement>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

    <properties>
        <!-- project / plugin related properties -->
        <github.global.server>github</github.global.server>
        <maven.compiler.target>1.8</maven.compiler.target>
        <maven.compiler.source>1.8</maven.compiler.source>
        <plugin.version.github.site>0.12</plugin.version.github.site>
        <plugin.version.gwt.maven>1.0-rc-9</plugin.version.gwt.maven>
        <plugin.version.processor.plugin>3.1.0</plugin.version.processor.plugin>
        <plugin.version.project.info.report>2.8</plugin.version.project.info.report>
        <plugin.version.sonatype>1.6.3</plugin.version.sonatype>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

        <!-- dependency versions -->
        <apt-tools.version>0.0.3</apt-tools.version>
        <auto-service.version>1.0-rc3</auto-service.version>
        <auto-value.version>1.2-SNAPSHOT</auto-value.version>
        <elemental.version>1.0.0-beta-3</elemental.version>
        <gwt.version>2.8.2</gwt.version>
        <gwtmockito.version>1.1.6</gwtmockito.version>
        <javax.inject.version>1</javax.inject.version>
        <jsoup.version>1.10.3</jsoup.version>
        <junit.version>4.12</junit.version>
    </properties>

    <modules>
        <module>core</module>
        <module>template</module>
    </modules>

    <dependencyManagement>
        <dependencies>
            <!-- Elemento -->
            <dependency>
                <groupId>org.jboss.gwt.elemento</groupId>
                <artifactId>elemento-core</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jboss.gwt.elemento</groupId>
                <artifactId>elemento-template</artifactId>
                <version>${project.version}</version>
            </dependency>

            <!-- GWT related -->
            <dependency>
                <groupId>com.google.gwt</groupId>
                <artifactId>gwt</artifactId>
                <version>${gwt.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>com.google.elemental2</groupId>
                <artifactId>elemental2-core</artifactId>
                <version>${elemental.version}</version>
            </dependency>
            <dependency>
                <groupId>com.google.elemental2</groupId>
                <artifactId>elemental2-dom</artifactId>
                <version>${elemental.version}</version>
            </dependency>
            <dependency>
                <groupId>com.google.elemental2</groupId>
                <artifactId>elemental2-webstorage</artifactId>
                <version>${elemental.version}</version>
            </dependency>

            <!-- Misc -->
            <dependency>
                <groupId>org.jsoup</groupId>
                <artifactId>jsoup</artifactId>
                <version>${jsoup.version}</version>
            </dependency>

            <!-- APT processing -->
            <dependency>
                <groupId>org.jboss.auto</groupId>
                <artifactId>apt-tools</artifactId>
                <version>${apt-tools.version}</version>
            </dependency>
            <dependency>
                <groupId>com.google.auto.service</groupId>
                <artifactId>auto-service</artifactId>
                <version>${auto-service.version}</version>
            </dependency>

            <!-- Test -->
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${junit.version}</version>
            </dependency>
            <dependency>
                <groupId>com.google.gwt.gwtmockito</groupId>
                <artifactId>gwtmockito</artifactId>
                <version>${gwtmockito.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>net.ltgt.gwt.maven</groupId>
                    <artifactId>gwt-maven-plugin</artifactId>
                    <version>${plugin.version.gwt.maven}</version>
                    <extensions>true</extensions>
                </plugin>
                <plugin>
                    <groupId>org.bsc.maven</groupId>
                    <artifactId>maven-processor-plugin</artifactId>
                    <version>${plugin.version.processor.plugin}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-project-info-reports-plugin</artifactId>
                    <version>${plugin.version.project.info.report}</version>
                </plugin>
                <plugin>
                    <groupId>com.github.github</groupId>
                    <artifactId>site-maven-plugin</artifactId>
                    <version>${plugin.version.github.site}</version>
                </plugin>
                <plugin>
                    <groupId>org.sonatype.plugins</groupId>
                    <artifactId>nexus-staging-maven-plugin</artifactId>
                    <version>${plugin.version.sonatype}</version>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <dependencies>
                    <dependency>
                        <groupId>com.puppycrawl.tools</groupId>
                        <artifactId>checkstyle</artifactId>
                        <version>${version.checkstyle}</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <id>checkstyle</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <configuration>
                            <configLocation>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>samples</id>
            <modules>
                <module>samples</module>
            </modules>
        </profile>

        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <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-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</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>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>com.github.github</groupId>
                        <artifactId>site-maven-plugin</artifactId>
                        <configuration>
                            <branch>refs/heads/site</branch>
                            <message>Creating site for ${project.name} ${project.version}</message>
                        </configuration>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>site</goal>
                                </goals>
                                <phase>site</phase>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>

            <reporting>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-project-info-reports-plugin</artifactId>
                        <reportSets>
                            <reportSet>
                                <reports>
                                    <report>index</report>
                                </reports>
                            </reportSet>
                        </reportSets>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <configuration>
                            <detectLinks>true</detectLinks>
                            <links>
                                <link>http://www.gwtproject.org/javadoc/latest/</link>
                            </links>
                            <excludePackageNames>
                                org.jboss.gwt.elemento.processor:org.jboss.gwt.elemento.processor.context
                            </excludePackageNames>
                        </configuration>
                        <reportSets>
                            <reportSet>
                                <id>aggregate</id>
                                <reports>
                                    <report>aggregate</report>
                                </reports>
                            </reportSet>
                        </reportSets>
                    </plugin>
                </plugins>
            </reporting>
        </profile>
    </profiles>

    <repositories>
        <repository>
            <id>jboss-public-repository-group</id>
            <name>JBoss Public Maven Repository Group</name>
            <url>https://repository.jboss.org/nexus/content/groups/public/</url>
        </repository>
        <repository>
            <id>oss-sonatype</id>
            <name>oss-sonatype</name>
            <url>https://oss.sonatype.org/content/repositories/google-snapshots/</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </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>
