<?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>
    <artifactId>oss-parent</artifactId>
    <groupId>org.sonatype.oss</groupId>
    <version>7</version>
  </parent>
  <groupId>org.e-hoffman.build</groupId>
  <artifactId>DeploymentConfiguration</artifactId>
  <version>1.0.4</version>
  <packaging>pom</packaging>
  <name>${project.artifactId}</name>
  <description>A Maven project providing only what is need to build a clean maven site, with a bit of pizazz.
      Produces site.xml and -site.jar that contains core artifacts for site generation.
      Also handles deployment to maven central.</description>
  <url>http://rexhoffman.github.io/MavenParent/index.html</url>
  <inceptionYear>2013</inceptionYear>
  <organization>
    <url>http://www.e-hoffman.org</url>
  </organization>
  <licenses>
    <license>
      <name>MIT license</name>
      <url>http://www.opensource.org/licenses/MIT</url>
    </license>
  </licenses>
  <developers>
    <developer>
      <id>rexhoffman</id>
      <email>rex@e-hoffman.org</email>
      <timezone>-8</timezone>
    </developer>
  </developers>
  <modules>
    <module>StaticAnalysisConf</module>
    <module>OpenSourceParent</module>
  </modules>
  <scm>
    <connection>scm:git:git:github.com:${github.owner}/${github.project}.git</connection>
    <developerConnection>scm:git:git:github.com:${github.owner}/${github.project}.git</developerConnection>
    <url>https://github.com/${github.owner}/${github.project}/blob/master/</url>
  </scm>
  <issueManagement>
    <system>Github Issues</system>
    <url>https://www.github.com/${github.owner}/${github.project}/issues</url>
  </issueManagement>
  <ciManagement>
    <notifiers>
      <notifier>
        <sendOnError>true</sendOnError>
        <sendOnFailure>true</sendOnFailure>
      </notifier>
    </notifiers>
  </ciManagement>
  <distributionManagement>
    <repository>
      <id>sonatype-nexus-staging</id>
      <name>Nexus Release Repository</name>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
    <snapshotRepository>
      <id>sonatype-nexus-snapshots</id>
      <name>Sonatype Nexus Snapshots</name>
      <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
    </snapshotRepository>
  </distributionManagement>
  <properties>
    <github.owner>rexhoffman</github.owner>
    <github.project>MavenParent</github.project>
    <github.global.server>github</github.global.server>
    <github.site.location>${project.version}/</github.site.location>
  </properties>
  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-site-plugin</artifactId>
          <version>3.3</version>
          <dependencies>
            <dependency>
              <groupId>org.apache.maven.skins</groupId>
              <artifactId>maven-fluido-skin</artifactId>
              <version>1.3.1</version>
            </dependency>
            <dependency>
              <groupId>org.apache.maven.wagon</groupId>
              <artifactId>wagon-webdav-jackrabbit</artifactId>
              <version>2.6</version>
            </dependency>
            <dependency>
              <groupId>org.apache.jackrabbit</groupId>
              <artifactId>jackrabbit-webdav</artifactId>
              <version>2.7.3</version>
            </dependency>
          </dependencies>
          <configuration>
            <relativizeDecorationLinks>false</relativizeDecorationLinks>
            <attach>false</attach>
            <reportPlugins>
              <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <version>2.7</version>
              </plugin>
            </reportPlugins>
          </configuration>
        </plugin>
        <plugin>
          <!-- replace the default deploy plugin and instead performs a deferred deploy, only deploying artifacts if all projects in a reactor build succeed. -->
          <groupId>org.sonatype.plugins</groupId>
          <artifactId>nexus-staging-maven-plugin</artifactId>
          <version>1.6</version>
          <extensions>true</extensions>
          <configuration>
            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
            <serverId>sonatype-nexus-staging</serverId>
          </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>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <version>1.7</version>
        <executions>
          <execution>
            <id>remove-zero-byte-files-NEXUS-2955</id>
            <phase>site</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <target>
                <taskdef resource="net/sf/antcontrib/antcontrib.properties"></taskdef>
                <taskdef classname="net.sf.antcontrib.logic.ForTask" name="for"></taskdef>
                <for param="file">
                  <path>
                    <fileset dir="${project.build.directory}/site/">
                      <size value="0" when="equal"></size>
                      <include name="**/*.html"></include>
                      <include name="**/*.css"></include>
                    </fileset>
                  </path>
                  <sequential>
                    <echo message="Fixing Nexus Bug NEXUS-2955 on file @{file}"></echo>
                    <echo file="@{file}"><![CDATA[Empty file: Fixed Nexus Bug NEXUS-2955]]></echo>
                  </sequential>
                </for>
              </target>
            </configuration>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>ant-contrib</groupId>
            <artifactId>ant-contrib</artifactId>
            <version>1.0b3</version>
            <exclusions>
              <exclusion>
                <artifactId>ant</artifactId>
                <groupId>ant</groupId>
              </exclusion>
            </exclusions>
          </dependency>
        </dependencies>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
        <executions>
          <execution>
            <id>attach-descriptor</id>
            <goals>
              <goal>attach-descriptor</goal>
              <goal>jar</goal>
            </goals>
            <inherited>false</inherited>
            <configuration>
              <attach>true</attach>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.sonatype.plugins</groupId>
        <artifactId>nexus-staging-maven-plugin</artifactId>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>nexus-release</id>
      <activation>
        <property>
          <name>gpg.passphrase</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>github-site-deploy</id>
      <activation>
        <property>
          <name>sitedeploy</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>com.github.github</groupId>
            <artifactId>site-maven-plugin</artifactId>
            <version>0.9</version>
            <executions>
              <execution>
                <phase>site</phase>
                <goals>
                  <goal>site</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <path>${github.site.location}</path>
              <merge>true</merge>
              <message>Creating site for ${project.version}</message>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
