<?xml version="1.0"?>
<!--

    Copyright (C) 2017 Red Hat, Inc (ncross@redhat.com)

    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.commonjava</groupId>
    <artifactId>commonjava</artifactId>
    <version>11</version>
  </parent>

  <groupId>org.goots.maven.plugins</groupId>
  <artifactId>pom-deployer-maven-plugin</artifactId>

  <packaging>maven-plugin</packaging>

  <version>1.2</version>

  <name>pom-deployer-maven-plugin</name>
  <url>https://github.com/rnc/pom-deployer-maven-plugin</url>

  <description>Plugin to install and deploy a specified XML (POM) file to a custom groupId:artifactId location</description>
  <inceptionYear>2017</inceptionYear>

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

  <developers>
    <developer>
      <id>rnc</id>
      <name>Nick Cross</name>
      <email>ncross@redhat.com</email>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:http://github.com/rnc/pom-deployer-maven-plugin.git</connection>
    <developerConnection>scm:git:git@github.com:rnc/pom-deployer-maven-plugin.git</developerConnection>
    <url>http://github.com/rnc/pom-deployer-maven-plugin</url>
    <tag>pom-deployer-maven-plugin-1.2</tag>
  </scm>

  <properties>
    <github.global.server>github</github.global.server>
    <projectOwner>Red Hat, Inc</projectOwner>
    <projectEmail>ncross@redhat.com</projectEmail>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven</artifactId>
        <version>3.0.5</version>
        <scope>import</scope>
        <type>pom</type>
      </dependency>
      <dependency>
        <groupId>org.apache.maven.plugin-tools</groupId>
        <artifactId>maven-plugin-annotations</artifactId>
        <version>3.4</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-artifact</artifactId>
        <version>2.2.1</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-model</artifactId>
        <version>3.0.5</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-model-builder</artifactId>
        <version>3.0.5</version>
      </dependency>
      <dependency>
        <groupId>org.twdata.maven</groupId>
        <artifactId>mojo-executor</artifactId>
        <version>2.3.0</version>
      </dependency>
      <dependency>
        <groupId>org.codehaus.plexus</groupId>
        <artifactId>plexus-utils</artifactId>
        <version>2.0.6</version>
      </dependency>
      <dependency>
        <groupId>commons-lang</groupId>
        <artifactId>commons-lang</artifactId>
        <version>2.5</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-core</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-plugin-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.plugin-tools</groupId>
      <artifactId>maven-plugin-annotations</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-artifact</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-model</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-model-builder</artifactId>
    </dependency>
    <dependency>
      <groupId>org.codehaus.plexus</groupId>
      <artifactId>plexus-utils</artifactId>
    </dependency>
    <dependency>
      <groupId>org.twdata.maven</groupId>
      <artifactId>mojo-executor</artifactId>
    </dependency>
    <dependency>
      <groupId>commons-lang</groupId>
      <artifactId>commons-lang</artifactId>
    </dependency>
  </dependencies>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>com.mycila</groupId>
          <artifactId>license-maven-plugin</artifactId>
          <version>2.10</version>
          <configuration>
            <header>com/mycila/maven/plugin/license/templates/APACHE-2.txt</header>
            <properties>
              <owner>${projectOwner}</owner>
              <email>${projectEmail}</email>
            </properties>
            <excludes>
              <exclude>**/README</exclude>
              <exclude>**/LICENSE*</exclude>
              <exclude>src/test/resources/**</exclude>
              <exclude>src/main/resources/**</exclude>
              <exclude>**/*.groovy</exclude>
            </excludes>
            <mapping>
              <!-- Workaround for https://github.com/mycila/license-maven-plugin/pull/109 -->
              <java>SLASHSTAR_STYLE</java>
              <service>SCRIPT_STYLE</service>
            </mapping>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-plugin-plugin</artifactId>
        <executions>
          <execution>
            <id>default-descriptor</id>
            <phase>process-classes</phase>
            <goals>
              <goal>descriptor</goal>
            </goals>
          </execution>
          <execution>
            <id>generated-helpmojo</id>
            <goals>
              <goal>helpmojo</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-invoker-plugin</artifactId>
        <version>2.0.0</version>
        <executions>
          <execution>
            <id>integration-test</id>
            <goals>
              <goal>install</goal>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
            <configuration>
              <properties>
                <testVersion>${project.version}</testVersion>
              </properties>
              <debug>true</debug>
              <goals>
                <goal>clean</goal>
                <goal>package</goal>
              </goals>
              <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
              <goals>
                <goal>install</goal>
              </goals>
              <!-- mavenExecutable>mvnDebug</mavenExecutable -->
              <pomIncludes>
                <pomInclude>*/pom.xml</pomInclude>
              </pomIncludes>
              <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
              <cloneClean>true</cloneClean>
              <postBuildHookScript>verify</postBuildHookScript>
              <settingsFile>src/it/settings.xml</settingsFile>
              <addTestClassPath>true</addTestClassPath>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
        <dependencies>
          <dependency>
            <groupId>org.apache.maven.doxia</groupId>
            <artifactId>doxia-module-markdown</artifactId>
            <version>1.6</version>
          </dependency>
        </dependencies>
      </plugin>
    </plugins>
  </build>

  <!-- Inspired by https://danielflower.github.io/2015/01/29/Generating-a-Maven-plugin-site-and-publishing-to-Github-Pages.html -->
  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>com.github.github</groupId>
            <artifactId>site-maven-plugin</artifactId>
            <version>0.12</version>
            <configuration>
              <message>Creating site for ${project.version}</message>
            </configuration>
            <executions>
              <execution>
                <goals>
                  <goal>site</goal>
                </goals>
                <phase>site</phase>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
        <id>disable-java8-doclint</id>
        <activation>
            <jdk>[1.8,)</jdk>
        </activation>
        <properties>
            <additionalparam>-Xdoclint:none</additionalparam>
        </properties>
    </profile>

  </profiles>


  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-plugin-plugin</artifactId>
        <version>3.2</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <version>2.9</version>
        <reportSets>
          <reportSet>
            <reports>
              <report>project-team</report>
              <report>cim</report>
              <report>issue-tracking</report>
              <report>license</report>
              <report>summary</report>
              <report>scm</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>
    </plugins>
  </reporting>

</project>
