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

    Copyright (C) 2012 Red Hat, Inc. (jcasey@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/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>com.redhat.rcm</groupId>
    <artifactId>redhat-releng-tools</artifactId>
    <version>1</version>
  </parent>

  <groupId>org.commonjava.maven.ext</groupId>
  <artifactId>pom-manipulation-parent</artifactId>
  <version>1.6</version>
  <packaging>pom</packaging>

  <name>POM Manipulation Extension for Maven</name>
  <url>http://github.com/jdcasey/pom-manipulation-ext</url>
  <inceptionYear>2012</inceptionYear>

  <description>
    Manipulation Tool (available as library, extension and CLI) for Apache Maven that allows pre-processing of Maven pom.xml's.
  </description>

  <licenses>
    <license>
      <name>APLv2.0</name>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <developers>
    <developer>
      <id>jdcasey</id>
      <name>John Casey</name>
      <email>jdcasey@commonjava.org</email>
    </developer>
    <developer>
      <id>rnc</id>
      <name>Nick Cross</name>
      <email>ncross@redhat.com</email>
    </developer>
    <developer>
      <id>pgier</id>
      <name>Paul Gier</name>
      <email>pgier@redhat.com</email>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:http://github.com/release-engineering/pom-manipulation-ext.git</connection>
    <developerConnection>scm:git:git@github.com:release-engineering/pom-manipulation-ext.git</developerConnection>
    <url>http://github.com/release-engineering/pom-manipulation-ext</url>
    <tag>pom-manipulation-parent-1.6</tag>
  </scm>

  <distributionManagement>
    <repository>
      <id>sonatype-nexus-staging</id>
      <name>Nexus Release Repository</name>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
  </distributionManagement>

  <properties>
    <projectOwner>Red Hat, Inc.</projectOwner>
    <projectEmail>jcasey@redhat.com</projectEmail>

    <javaVersion>1.6</javaVersion>

    <maeVersion>1.0-alpha-1</maeVersion>
    <mavenVersion>3.0.4</mavenVersion>
    <galleyVersion>0.9.1</galleyVersion>
    <atlasVersion>0.13.6</atlasVersion>
    <it.maven.home>${project.build.directory}/apache-maven-${mavenVersion}</it.maven.home>

  </properties>


  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.commonjava.maven.ext</groupId>
        <artifactId>pom-manipulation-core</artifactId>
        <version>${project.version}</version>
      </dependency>

      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-artifact</artifactId>
        <version>${mavenVersion}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-compat</artifactId>
        <version>${mavenVersion}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-core</artifactId>
        <version>${mavenVersion}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-model</artifactId>
        <version>${mavenVersion}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-model-builder</artifactId>
        <version>${mavenVersion}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-settings</artifactId>
        <version>${mavenVersion}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-settings-builder</artifactId>
        <version>${mavenVersion}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>apache-maven</artifactId>
        <version>${mavenVersion}</version>
        <type>zip</type>
        <classifier>bin</classifier>
        <scope>test</scope>
      </dependency>

      <dependency>
        <groupId>org.codehaus.plexus</groupId>
        <artifactId>plexus-component-annotations</artifactId>
        <version>1.5.5</version>
      </dependency>
      <dependency>
        <groupId>org.codehaus.plexus</groupId>
        <artifactId>plexus-interpolation</artifactId>
        <version>1.14</version>
      </dependency>
      <dependency>
        <groupId>org.codehaus.plexus</groupId>
        <artifactId>plexus-utils</artifactId>
        <version>2.0.6</version>
      </dependency>

      <dependency>
        <groupId>org.commonjava.maven.atlas</groupId>
        <artifactId>atlas-identities</artifactId>
        <version>${atlasVersion}</version>
      </dependency>
      <dependency>
        <groupId>org.commonjava.maven.galley</groupId>
        <artifactId>galley-api</artifactId>
        <version>${galleyVersion}</version>
      </dependency>
      <dependency>
        <groupId>org.commonjava.maven.galley</groupId>
        <artifactId>galley-core</artifactId>
        <version>${galleyVersion}</version>
      </dependency>
      <dependency>
        <groupId>org.commonjava.maven.galley</groupId>
        <artifactId>galley-transport-httpclient</artifactId>
        <version>${galleyVersion}</version>
      </dependency>
      <dependency>
        <groupId>org.commonjava.maven.galley</groupId>
        <artifactId>galley-transport-filearc</artifactId>
        <version>${galleyVersion}</version>
      </dependency>
      <dependency>
        <groupId>org.commonjava.maven.galley</groupId>
        <artifactId>galley-maven</artifactId>
        <version>${galleyVersion}</version>
      </dependency>

      <dependency>
        <groupId>commons-cli</groupId>
        <artifactId>commons-cli</artifactId>
        <version>1.3.1</version>
      </dependency>
      <dependency>
        <groupId>commons-io</groupId>
        <artifactId>commons-io</artifactId>
        <version>2.4</version>
      </dependency>
      <dependency>
        <groupId>commons-lang</groupId>
        <artifactId>commons-lang</artifactId>
        <version>2.5</version>
      </dependency>
      <dependency>
        <groupId>org.jdom</groupId>
        <artifactId>jdom2</artifactId>
        <version>2.0.6</version>
      </dependency>
      <dependency>
        <groupId>org.commonjava.maven</groupId>
        <artifactId>maven3-model-jdom-support</artifactId>
        <version>1.3.1</version>
      </dependency>

      <dependency>
        <groupId>org.sonatype.aether</groupId>
        <artifactId>aether-api</artifactId>
        <version>1.13.1</version>
      </dependency>
      <dependency>
        <groupId>org.sonatype.sisu</groupId>
        <artifactId>sisu-inject-plexus</artifactId>
        <version>2.3.0</version>
      </dependency>

      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>1.7.7</version>
      </dependency>

      <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-classic</artifactId>
        <version>1.0.12</version>
      </dependency>
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.10</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.jboss.byteman</groupId>
        <artifactId>byteman-bmunit</artifactId>
        <version>2.1.4.1</version>
        <scope>test</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-assembly-plugin</artifactId>
          <executions>
            <execution>
              <id>make-assembly</id>
              <phase>prepare-package</phase>
              <goals>
                <goal>single</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-resources-plugin</artifactId>
          <version>2.6</version>
          <configuration>
            <escapeString>\</escapeString>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-release-plugin</artifactId>
          <configuration>
            <mavenExecutorId>forked-path</mavenExecutorId>
            <useReleaseProfile>false</useReleaseProfile>
            <arguments>-Prelease,run-its</arguments>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-shade-plugin</artifactId>
          <version>2.4.1</version>
          <configuration>
            <archive>
              <index>true</index>
              <manifest>
                <addDefaultSpecificationEntries>
                  true
                </addDefaultSpecificationEntries>
                <addDefaultImplementationEntries>
                  true
                </addDefaultImplementationEntries>
              </manifest>
              <manifestEntries>
                <Implementation-URL>${project.url}</Implementation-URL>
                <Java-Version>${java.version}</Java-Version>
                <Java-Vendor>${java.vendor}</Java-Vendor>
                <Os-Name>${os.name}</Os-Name>
                <Os-Arch>${os.arch}</Os-Arch>
                <Os-Version>${os.version}</Os-Version>
                <Scm-Url>${project.scm.url}</Scm-Url>
                <Scm-Connection>${project.scm.connection}</Scm-Connection>
                <Scm-Revision>${buildNumber}</Scm-Revision>
                <Build-Timestamp>${datetime}</Build-Timestamp>
              </manifestEntries>
            </archive>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-dependency-plugin</artifactId>
          <version>2.8</version>
          <executions>
            <execution>
              <id>unpack-maven</id>
              <phase>pre-integration-test</phase>
              <goals>
                <goal>unpack-dependencies</goal>
              </goals>
              <configuration>
                <includeArtifactIds>apache-maven</includeArtifactIds>
                <includeClassifiers>bin</includeClassifiers>
                <includeTypes>zip</includeTypes>
                <outputDirectory>${project.build.directory}</outputDirectory>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-invoker-plugin</artifactId>
          <version>1.8</version>
          <executions>
            <execution>
              <id>integration-test</id>
              <goals>
                <goal>integration-test</goal>
                <goal>verify</goal>
              </goals>
              <configuration>
                <debug>true</debug>
                <goals>
                  <goal>clean</goal>
                  <goal>package</goal>
                </goals>
                <!-- <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo> -->
                <localRepositoryPath>${localRepositoryUrl}</localRepositoryPath>
                <mavenHome>${it.maven.home}</mavenHome>
                <setupIncludes>
                  <setupInclude>setup/*/pom.xml</setupInclude>
                </setupIncludes>
                <!-- mavenExecutable>mvnDebug</mavenExecutable -->
                <pomIncludes>
                  <!-- <pomInclude>remote-plugin-management-invalid/pom.xml</pomInclude> -->
                  <pomInclude>simple-numeric-directory-path/parent/pom.xml</pomInclude>
                  <pomInclude>*/pom.xml</pomInclude>
                </pomIncludes>
                <projectsDirectory>${project.build.directory}/it</projectsDirectory>
                <postBuildHookScript>verify</postBuildHookScript>
                <settingsFile>src/it/settings.xml</settingsFile>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.18.1</version>
          <configuration>
            <redirectTestOutputToFile>true</redirectTestOutputToFile>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>buildnumber-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
      </plugin>
    </plugins>

  </build>

  <modules>
    <module>core</module>
    <module>cli</module>
    <module>ext</module>
  </modules>

  <profiles>
    <profile>
      <id>formatting</id>
      <build>
        <plugins>
          <plugin>
            <groupId>com.mycila</groupId>
            <artifactId>license-maven-plugin</artifactId>
            <executions>
              <execution>
                <phase>process-sources</phase>
                <goals>
                  <goal>format</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>com.mycila</groupId>
            <artifactId>license-maven-plugin</artifactId>
            <executions>
              <execution>
                <goals>
                  <goal>check</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-source-plugin</artifactId>
          </plugin>
          <plugin>
            <artifactId>maven-gpg-plugin</artifactId>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
