<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2015 Danilo Reinert
  ~
  ~ 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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>org.sonatype.oss</groupId>
    <artifactId>oss-parent</artifactId>
    <version>7</version>
  </parent>

  <packaging>pom</packaging>

  <groupId>io.reinert.requestor</groupId>
  <artifactId>requestor-project</artifactId>
  <version>0.2.0</version>

  <name>Requestor</name>
  <description>Requesting made easy for GWT.</description>
  <inceptionYear>2014</inceptionYear>
  <url>http://github.com/reinert/requestor</url>

  <modules>
    <module>requestor</module>
  </modules>

  <properties>
    <target.jdk>1.6</target.jdk>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

    <!-- Plugins -->
    <maven-checkstyle-plugin.version>2.11</maven-checkstyle-plugin.version>
    <maven-compiler-plugin.version>3.2</maven-compiler-plugin.version>
    <maven-deploy-plugin.version>2.8.1</maven-deploy-plugin.version>
    <maven-gpg-plugin.version>1.5</maven-gpg-plugin.version>
    <maven-jar-plugin.version>2.5</maven-jar-plugin.version>
    <maven-javadoc-plugin.version>2.9.1</maven-javadoc-plugin.version>
    <maven-release-plugin.version>2.5.1</maven-release-plugin.version>
    <maven-resources-plugin.version>2.7</maven-resources-plugin.version>
    <maven-site-plugin.version>3.4</maven-site-plugin.version>
    <doxia-module-markdown.version>1.6</doxia-module-markdown.version>
    <maven-scm-plugin.version>1.9.2</maven-scm-plugin.version>
    <maven-source-plugin.version>2.2.1</maven-source-plugin.version>
    <maven-surefire-plugin.version>2.16</maven-surefire-plugin.version>
    <github.version>0.10</github.version>

    <!-- GWT -->
    <gwt.version>2.7.0</gwt.version>
    <turbogwt.version>0.4.0</turbogwt.version>
    <gdeferred.version>0.9.0</gdeferred.version>
    <gwtjackson.version>0.7.0</gwtjackson.version>

    <!-- Java -->
    <checkstyle.version>6.0</checkstyle.version>
    <annotation.version>1.2</annotation.version>

    <!-- Testing -->
    <gwtmockito.version>1.1.4</gwtmockito.version>
    <mockito.version>1.10.8</mockito.version>
    <junit.version>4.11</junit.version>

    <!-- Site -->
    <rootDirectory>${basedir}</rootDirectory>
    <site.examplesDirectory>${rootDirectory}/target/site/examples</site.examplesDirectory>
    <sitePath>${project.version}</sitePath>
  </properties>

  <scm>
    <connection>scm:git:ssh://github.com/reinert/requestor.git</connection>
    <developerConnection>scm:git:ssh://git@github.com/reinert/requestor.git</developerConnection>
    <url>https://github.com/reinert/requestor</url>
    <tag>0.2.0</tag>
  </scm>

  <issueManagement>
    <url>https://github.com/reinert/requestor/issues</url>
    <system>Github Issues</system>
  </issueManagement>

  <distributionManagement>
    <site>
      <id>github-pages-site</id>
      <name>Deployment through GitHub's site deployment plugin</name>
      <url>${sitePath}</url>
    </site>
    <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>

  <licenses>
    <license>
      <name>Apache 2</name>
      <url>https://raw.githubusercontent.com/reinert/requestor/master/LICENSE</url>
    </license>
  </licenses>

  <developers>
    <developer>
      <id>reinert</id>
      <name>Danilo Reinert</name>
      <email>daniloreinert@growbit.com</email>
      <organization>Grow bit</organization>
      <organizationUrl>http://growbit.com</organizationUrl>
      <roles>
        <role>architect</role>
        <role>lead developer</role>
      </roles>
      <timezone>-3</timezone>
    </developer>
  </developers>

  <dependencyManagement>
    <dependencies>
      <!-- Custom dependencies -->
      <dependency>
        <groupId>io.reinert.gdeferred</groupId>
        <artifactId>gdeferred</artifactId>
        <version>${gdeferred.version}</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>org.turbogwt.core</groupId>
        <artifactId>turbogwt-core</artifactId>
        <version>${turbogwt.version}</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>com.github.nmorel.gwtjackson</groupId>
        <artifactId>gwt-jackson</artifactId>
        <version>${gwtjackson.version}</version>
        <scope>provided</scope>
      </dependency>

      <!-- GWT dependencies -->
      <dependency>
        <groupId>com.google.gwt</groupId>
        <artifactId>gwt-user</artifactId>
        <version>${gwt.version}</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>com.google.gwt</groupId>
        <artifactId>gwt-dev</artifactId>
        <version>${gwt.version}</version>
        <scope>provided</scope>
      </dependency>

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

      <!-- Tools -->
      <dependency>
        <groupId>io.reinert.requestor.tools</groupId>
        <artifactId>requestor-checkstyle</artifactId>
        <version>${project.version}</version>
        <scope>provided</scope>
        <optional>true</optional>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>${maven-javadoc-plugin.version}</version>
          <configuration>
            <maxmemory>2048</maxmemory>
            <failOnError>true</failOnError>
            <doctitle>Requestor ${project.version} API</doctitle>
            <links>
              <link>http://download.oracle.com/javase/7/docs/api/</link>
              <link>http://www.gwtproject.org/javadoc/latest/</link>
            </links>
            <outputDirectory>${project.build.directory}/javadoc</outputDirectory>
            <reportOutputDirectory>${project.reporting.outputDirectory}/javadoc</reportOutputDirectory>
            <excludes>
              <exclude>**/*.txt</exclude>
            </excludes>
            <header>
              <![CDATA[
                <a href="https://github.com/reinert/requestor" target="_blank">Back to Home</a>
              ]]>
            </header>
            <doclet>org.umlgraph.doclet.UmlGraphDoc</doclet>
            <docletArtifact>
              <groupId>org.umlgraph</groupId>
              <artifactId>umlgraph</artifactId>
              <version>5.6.6</version>
            </docletArtifact>
            <additionalparam>-horizontal</additionalparam>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-release-plugin</artifactId>
          <version>${maven-release-plugin.version}</version>
          <configuration>
            <tagNameFormat>requestor-@{project.version}</tagNameFormat>
            <autoVersionSubmodules>true</autoVersionSubmodules>
            <useReleaseProfile>false</useReleaseProfile>
            <goals>deploy</goals>
            <arguments>-P!project,release -Dcheckstyle.skip</arguments>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>
      <plugin>
        <groupId>org.sonatype.plugins</groupId>
        <artifactId>nexus-staging-maven-plugin</artifactId>
        <version>1.6.3</version>
        <extensions>true</extensions>
        <configuration>
          <serverId>ossrh</serverId>
          <nexusUrl>https://oss.sonatype.org/</nexusUrl>
          <autoReleaseAfterClose>true</autoReleaseAfterClose>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-deploy-plugin</artifactId>
        <version>${maven-deploy-plugin.version}</version>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>project</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <modules>
        <module>tools</module>
        <module>requestor</module>
        <module>examples</module>
      </modules>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-checkstyle-plugin</artifactId>
              <version>${maven-checkstyle-plugin.version}</version>
              <configuration>
                <configLocation>/requestor-checkstyle.xml</configLocation>
                <suppressionsLocation>/requestor-checkstyle-suppressions.xml</suppressionsLocation>
                <propertiesLocation>/requestor-checkstyle.properties</propertiesLocation>
                <propertyExpansion>basedir=${basedir}</propertyExpansion>
                <consoleOutput>true</consoleOutput>
                <failsOnError>true</failsOnError>
                <linkXRef>false</linkXRef>
                <includeTestSourceDirectory>true</includeTestSourceDirectory>
              </configuration>
              <dependencies>
                <dependency>
                  <groupId>io.reinert.requestor.tools</groupId>
                  <artifactId>requestor-checkstyle</artifactId>
                  <version>${project.version}</version>
                </dependency>
              </dependencies>
              <executions>
                <execution>
                  <id>validate</id>
                  <phase>validate</phase>
                  <goals>
                    <goal>checkstyle</goal>
                  </goals>
                </execution>
              </executions>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>

    <profile>
      <id>site</id>
      <modules>
        <module>requestor</module>
      </modules>
      <activation>
        <property>
          <name>release</name>
        </property>
      </activation>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-site-plugin</artifactId>
              <version>${maven-site-plugin.version}</version>
              <configuration>
                <skipDeploy>true</skipDeploy>
              </configuration>
              <dependencies>
                <dependency>
                  <groupId>org.apache.maven.doxia</groupId>
                  <artifactId>doxia-module-markdown</artifactId>
                  <version>${doxia-module-markdown.version}</version>
                </dependency>
              </dependencies>
            </plugin>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-javadoc-plugin</artifactId>
              <executions>
                <execution>
                  <id>build-upload-javadocs</id>
                  <phase>site</phase>
                  <goals>
                    <goal>aggregate</goal>
                  </goals>
                </execution>
              </executions>
            </plugin>
            <plugin>
              <groupId>com.github.github</groupId>
              <artifactId>site-maven-plugin</artifactId>
              <version>${github.version}</version>
              <executions>
                <execution>
                  <goals>
                    <goal>site</goal>
                  </goals>
                  <phase>site-deploy</phase>
                  <configuration>
                    <server>github</server>
                    <message>Building site for Requestor ${project.version}</message>
                    <path>${project.distributionManagement.site.url}</path>
                    <merge>true</merge>
                  </configuration>
                </execution>
              </executions>
            </plugin>
          </plugins>
        </pluginManagement>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-site-plugin</artifactId>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
          </plugin>
          <plugin>
            <groupId>com.github.github</groupId>
            <artifactId>site-maven-plugin</artifactId>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>examples</id>
      <modules>
        <module>examples</module>
      </modules>
      <activation>
        <property>
          <name>presite</name>
        </property>
      </activation>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-resources-plugin</artifactId>
              <version>2.6</version>
              <executions>
                <execution>
                  <id>copy-resources</id>
                  <phase>install</phase>
                  <goals>
                    <goal>copy-resources</goal>
                  </goals>
                  <configuration>
                    <outputDirectory>${site.examplesDirectory}/${site.projectDirectory}</outputDirectory>
                    <resources>
                      <resource>
                        <directory>${project.basedir}/src/main/webapp</directory>
                      </resource>
                      <resource>
                        <directory>${project.build.directory}/${project.build.finalName}</directory>
                      </resource>
                    </resources>
                  </configuration>
                </execution>
              </executions>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>

    <profile>
      <id>release</id>
      <activation>
        <property>
          <name>release</name>
        </property>
      </activation>
      <modules>
        <module>requestor</module>
      </modules>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>${maven-source-plugin.version}</version>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar-no-fork</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-gpg-plugin</artifactId>
            <version>${maven-gpg-plugin.version}</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <pluginRepositories>
    <pluginRepository>
      <id>sonatype-nexus-snapshots</id>
      <name>Sonatype Nexus Snapshots</name>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
      <layout>default</layout>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </pluginRepository>
  </pluginRepositories>
</project>
