<?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>
  
  <parent>
    <groupId>org.sonatype.oss</groupId>
    <artifactId>oss-parent</artifactId>
    <version>9</version>
  </parent>

  <groupId>pl.matsuo.maven.skins</groupId>
  <artifactId>msb3-parent</artifactId>
  <version>0.1.1</version>
  <packaging>pom</packaging>

  <name>Msb3 Maven Skin Parent</name>
  <description>Msb3 Maven skin and supporting libraries parent</description>
  <inceptionYear>2015</inceptionYear>
  
  <prerequisites>
    <maven>3.0</maven>
  </prerequisites>

  <modules>
    <module>msb3-velocity-tools</module>
    <module>msb3-maven-skin</module>
  </modules>

  <properties>
    <site.url>https://tunguski.github.io/msb3-maven-skin</site.url>
    <github.global.server>github</github.global.server>
    <site.deploy.id>gh-pages</site.deploy.id>
    <site.deploy.url />

    <repositoryName>msb3-maven-skin</repositoryName>
    <repositoryOwner>tunguski</repositoryOwner>
  </properties>

  <url>${site.url}</url>

  <scm>
    <connection>scm:git:git@github.com:tunguski/msb3-maven-skin.git</connection>
    <developerConnection>scm:git:git@github.com:tunguski/msb3-maven-skin.git</developerConnection>
    <url>https://github.com/tunguski/msb3-maven-skin/tree/master</url>
    <tag>HEAD</tag>
  </scm>

  <issueManagement>
    <system>GitHub</system>
    <url>https://github.com/tunguski/msb3-maven-skin/issues</url>
  </issueManagement>

  <licenses>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <organization>
    <name>Marek Romanowski</name>
    <url>http://matsuo.pl</url>
  </organization>

  <developers>
    <developer>
      <id>tunguski</id>
      <name>Marek Romanowski</name>
      <timezone>0</timezone>
      <url>http://matsuo.pl</url>
    </developer>
  </developers>

  <build>
    <plugins>
      <!-- Configure Maven site plugin for Msb3 skin and Markdown support -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
        <version>3.4</version>
        <dependencies>
          <dependency>
            <groupId>pl.matsuo.maven.skins</groupId>
            <artifactId>msb3-velocity-tools</artifactId>
            <version>0.1.1</version>
          </dependency>
          <dependency>
            <!-- Msb3 skin requires velocity 1.7 -->
            <groupId>org.apache.velocity</groupId>
            <artifactId>velocity</artifactId>
            <version>1.7</version>
          </dependency>
        </dependencies>
        <configuration>
          <generateReports>true</generateReports>
          <inputEncoding>UTF-8</inputEncoding>
          <outputEncoding>UTF-8</outputEncoding>
          <!-- Site deployment done using GitHub site plugin -->
          <skipDeploy>true</skipDeploy>
        </configuration>
      </plugin>

      <plugin>
        <!-- GitHub site plug-in for deployment to GitHub pages -->
        <groupId>com.github.github</groupId>
        <artifactId>site-maven-plugin</artifactId>
        <version>0.12</version>
        <configuration>
          <message>Creating site for ${project.artifactId}, ${project.version}</message>
          <!-- this does the trick to place every module in the correct subfolder -->
          <path>${project.distributionManagement.site.url}</path>
          <merge>true</merge>
        </configuration>
        <executions>
          <execution>
            <id>github-site</id>
            <goals>
              <goal>site</goal>
            </goals>
            <phase>site-deploy</phase>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <version>2.5.3</version>
        <configuration>
          <pushChanges>false</pushChanges>
          <localCheckout>true</localCheckout>
        </configuration>
         <dependencies>
            <dependency>
               <groupId>org.apache.maven.scm</groupId>
               <artifactId>maven-scm-provider-gitexe</artifactId>
               <!-- This version is necessary for use with git version 1.8.5 -->
               <version>1.9.2</version>
            </dependency>
         </dependencies>
      </plugin>
    </plugins>

    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.3</version>
          <configuration>
            <source>1.6</source>
            <target>1.6</target>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <version>2.8.1</version>
        <configuration>
          <anonymousConnection>scm:git:git@github.com:tunguski/msb3-maven-skin.git</anonymousConnection>
          <developerConnection>scm:git:git@github.com:tunguski/msb3-maven-skin.git</developerConnection>
        </configuration>
        <reportSets>
          <reportSet>
            <reports>
              <report>summary</report>
              <report>license</report>
              <report>modules</report>
              <report>project-team</report>
              <report>scm</report>
              <report>issue-tracking</report>
              <report>dependencies</report>
              <report>dependency-convergence</report>
              <report>plugins</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-changes-plugin</artifactId>
        <version>2.11</version>
        <configuration>
          <includeOpenIssues>false</includeOpenIssues>
          <columnNames>Id,Type,Summary,Fix Version</columnNames>
        </configuration>
        <reportSets>
          <reportSet>
            <!-- Empty report set as default -->
            <reports>
            </reports>
          </reportSet>
          <reportSet>
            <id>release-notes</id>
            <inherited>false</inherited>
            <reports>
              <report>github-report</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>cobertura-maven-plugin</artifactId>
        <version>2.6</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jxr-plugin</artifactId>
        <version>2.5</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.19</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-pmd-plugin</artifactId>
        <version>3.6</version>
        <configuration>
          <targetjdk>1.6</targetjdk>
          <linkXref>true</linkXref>
          <format>xml</format>
          <sourceEncoding>utf-8</sourceEncoding>
          <minimumTokens>100</minimumTokens>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>taglist-maven-plugin</artifactId>
        <version>2.4</version>
      </plugin>
    </plugins>
  </reporting>

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

  <profiles>
    <profile>
      <id>stage</id>
      <properties>
        <site.deploy.url>https://github.com/tunguski/msb3-maven-skin/tree/gh-pages/</site.deploy.url>
      </properties>

      <build>
        <plugins>
          <!-- Configure Maven site plugin to perform stage -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-site-plugin</artifactId>
            <version>3.4</version>
            <executions>
              <execution>
                <id>stage</id>
                <goals>
                  <goal>stage</goal>
                </goals>
                <phase>site</phase>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>

    </profile>


    <profile>
      <id>release</id>

      <build>
        <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>
            <artifactId>maven-source-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
    
          <plugin>
            <artifactId>maven-javadoc-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <phase>verify</phase>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <additionalparam>${javadoc.opts}</additionalparam>
            </configuration>
          </plugin>

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.5</version>
            <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-release-plugin</artifactId>
            <version>2.5.1</version>
            <configuration>
              <pushChanges>false</pushChanges>
              <localCheckout>true</localCheckout>
            </configuration>
            <dependencies>
              <dependency>
                <groupId>org.apache.maven.scm</groupId>
                <artifactId>maven-scm-provider-gitexe</artifactId>
                <!-- This version is necessary for use with git version 1.8.5 -->
                <version>1.9.2</version>
              </dependency>
            </dependencies>
          </plugin>
 
        </plugins>
      </build>
    </profile>

  </profiles>

</project>
