<?xml version="1.0" encoding="UTF-8"?>

<!--
  Licensed to the Apache Software Foundation (ASF) under one
  or more contributor license agreements. See the NOTICE file
  distributed with this work for additional information
  regarding copyright ownership. The ASF licenses this file
  to you 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.soebes.smpp</groupId>
    <artifactId>smpp</artifactId>
    <version>2.0.0</version>
  </parent>

  <groupId>com.soebes.maven.plugins</groupId>
  <artifactId>iterator-maven-plugin</artifactId>
  <version>0.4</version>
  <packaging>maven-plugin</packaging>

  <name>The Iterator Maven Plugin.</name>
  <description>The idea is to execute other plugins multiple times
    based on a list of items which will be iterated over.
    Or invoke a separate maven instance based on the a list 
    of elements.</description>

  <!--
    ! The following is marked as deprecated for Maven 3. so using maven-enforcer-plugin as well
    ! https://issues.apache.org/jira/browse/MNG-4840
    ! https://issues.apache.org/jira/browse/MNG-5297
  -->
  <prerequisites>
    <maven>${maven.version}</maven>
  </prerequisites>

  <distributionManagement>
    <site>
      <id>github</id>
      <url>scm:git:ssh://git@github.com/khmarbaise/iterator-maven-plugin.git</url>
    </site>
  </distributionManagement>

  <properties>
    <maven.version>3.0</maven.version>

    <!-- Different plugins versions -->
    <gmaven-plugin.version>1.5</gmaven-plugin.version>

    <maven-javadoc-plugin.version>2.9.1</maven-javadoc-plugin.version>

    <!-- dependency versions -->
    <org.codehaus.groovy-groovy.version>1.8.4</org.codehaus.groovy-groovy.version>
    <org.codehaus.gmaven.runtime-gmaven-runtime-1.8>1.4</org.codehaus.gmaven.runtime-gmaven-runtime-1.8>
    <!--
      ! Make mvn site:stage working correctly in combination with scm-publish.
    -->
    <scmpublish.content>target/staging/${project.artifactId}</scmpublish.content>
  </properties>

  <!-- Must be overwritten in every project. -->
  <issueManagement>
    <system>default</system>
    <url>https://github.com/khmarbaise/iterator-maven-plugin/issues</url>
  </issueManagement>

  <scm>
    <developerConnection>scm:git:ssh://git@github.com/khmarbaise/iterator-maven-plugin.git</developerConnection>
    <connection>scm:git:https://github.com/khmarbaise/iterator-maven-plugin.git</connection>
    <url>https://github.com/khmarbaise/iterator-maven-plugin</url>
    <tag>iterator-maven-plugin-0.4</tag>
  </scm>

  <contributors>
    <contributor>
      <name>Florian Fray</name>
      <email>florian.fray@itcf.biz</email>
      <url>http://itcf.biz</url>
      <roles>
        <role>Contributor</role>
      </roles>
    </contributor>
    <contributor>
      <name>Tunaki</name>
      <email>guillaume_boue@orange.fr</email>
      <url>https://github.com/Tunaki</url>
      <roles>
        <role>Contributor</role>
      </roles>
    </contributor>
  </contributors>

  <dependencyManagement>

    <dependencies>

      <dependency>
        <groupId>org.codehaus.groovy</groupId>
        <artifactId>groovy</artifactId>
        <version>${org.codehaus.groovy-groovy.version}</version>
      </dependency>
      <dependency>
        <groupId>org.codehaus.gmaven.runtime</groupId>
        <artifactId>gmaven-runtime-1.8</artifactId>
        <version>${org.codehaus.gmaven.runtime-gmaven-runtime-1.8}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>


  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.rat</groupId>
          <artifactId>apache-rat-plugin</artifactId>
          <version>0.11</version>
          <!--
            ! Currently workaround to prevent warnings
            ! See https://issues.apache.org/jira/browse/RAT-158
          -->
          <dependencies>
            <dependency>
              <groupId>org.apache.maven.doxia</groupId>
              <artifactId>doxia-core</artifactId>
              <version>1.6</version>
              <exclusions>
                <exclusion>
                  <groupId>xerces</groupId>
                  <artifactId>xercesImpl</artifactId>
                </exclusion>
              </exclusions>
            </dependency>
          </dependencies>
          <configuration>
            <excludes combine.children="append">
              <exclude>README.md</exclude>
              <exclude>src/site/resources/attached-includes/css/shCoreDefault.css</exclude>
              <exclude>.travis.yml</exclude>
              <!--
                ! This can be found on CI servers where the local cache is stored.
                ! Can be removed if 0.12 of apache-rat-plugin is released.
              -->
              <exclude>.repository/**</exclude>
            </excludes>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.codehaus.gmaven</groupId>
          <artifactId>gmaven-plugin</artifactId>
          <version>${gmaven-plugin.version}</version>
          <dependencies>
            <dependency>
              <groupId>org.codehaus.groovy</groupId>
              <artifactId>groovy</artifactId>
            </dependency>
            <dependency>
              <groupId>org.codehaus.gmaven.runtime</groupId>
              <artifactId>gmaven-runtime-1.8</artifactId>
            </dependency>
          </dependencies>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-plugin-plugin</artifactId>
          <version>3.4</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-site-plugin</artifactId>
          <dependencies>
            <dependency>
              <groupId>org.tinyjee.dim</groupId>
              <artifactId>doxia-include-macro</artifactId>
              <version>1.1</version>
            </dependency>
          </dependencies>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>${maven-javadoc-plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-scm-publish-plugin</artifactId>
          <version>${maven-scm-publish-plugin.version}</version>
          <configuration>
            <scmBranch>gh-pages</scmBranch>
            <content>${project.reporting.outputDirectory}</content>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>


    <plugins>
      <plugin>
        <groupId>org.apache.rat</groupId>
        <artifactId>apache-rat-plugin</artifactId>
        <executions>
          <execution>
            <phase>verify</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-plugin-plugin</artifactId>
        <configuration>
          <goalPrefix>iterator</goalPrefix>
        </configuration>
        <executions>
          <execution>
            <id>default-descriptor</id>
            <goals>
              <goal>descriptor</goal>
            </goals>
            <phase>process-classes</phase>
          </execution>
          <execution>
            <id>help-descriptor</id>
            <goals>
              <goal>helpmojo</goal>
            </goals>
            <phase>process-classes</phase>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
        <configuration>
          <reportPlugins>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-project-info-reports-plugin</artifactId>
              <version>${maven-project-info-reports-plugin.version}</version>
            </plugin>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-plugin-plugin</artifactId>
              <version>${maven-plugin-plugin.version}</version>
            </plugin>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-javadoc-plugin</artifactId>
              <version>${maven-javadoc-plugin.version}</version>
              <reportSets>
                <reportSet>
                  <id>default</id>
                  <reports>
                    <report>javadoc</report>
                    <report>test-javadoc</report>
                  </reports>
                </reportSet>
              </reportSets>
            </plugin>
          </reportPlugins>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.tinyjee.dim</groupId>
        <artifactId>doxia-include-macro</artifactId>
        <version>1.1</version>
        <executions>
          <execution>
            <id>initialize-doxia-include-macro</id>
            <phase>pre-site</phase>
            <goals>
              <goal>initialize</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <configuration>
          <releaseProfiles>run-its</releaseProfiles>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <dependencies>

    <dependency>
      <groupId>org.testng</groupId>
      <artifactId>testng</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-core</artifactId>
      <version>${maven.version}</version>
    </dependency>

    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-plugin-api</artifactId>
      <version>${maven.version}</version>
    </dependency>

    <dependency>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-plugin-plugin</artifactId>
      <version>3.4</version>
    </dependency>

    <dependency>
      <groupId>org.apache.maven.plugin-tools</groupId>
      <artifactId>maven-plugin-annotations</artifactId>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.maven.shared</groupId>
      <artifactId>maven-invoker</artifactId>
      <version>2.2</version>
    </dependency>

    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <scope>test</scope>
    </dependency>

    <!--
      ! currently needed for this:
      ! protected MavenPluginManagerHelper mavenPluginManagerHelper;
      ! TODO: Think about this.
    -->
    <dependency>
      <groupId>org.apache.maven.reporting</groupId>
      <artifactId>maven-reporting-exec</artifactId>
      <version>1.1</version>
    </dependency>

    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <version>2.4</version>
    </dependency>
  </dependencies>

  <profiles>
    <profile>
      <id>run-its</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.gmaven</groupId>
            <artifactId>gmaven-plugin</artifactId>
            <dependencies>
              <dependency>
                <groupId>org.codehaus.groovy</groupId>
                <artifactId>groovy</artifactId>
                <version>${org.codehaus.groovy-groovy.version}</version>
              </dependency>
              <dependency>
                <groupId>org.codehaus.gmaven.runtime</groupId>
                <artifactId>gmaven-runtime-1.8</artifactId>
                <version>${org.codehaus.gmaven.runtime-gmaven-runtime-1.8}</version>
              </dependency>
            </dependencies>
            <configuration>
              <debug>false</debug>
              <verbose>true</verbose>
              <stacktrace>true</stacktrace>
              <defaultScriptExtension>.groovy</defaultScriptExtension>
            </configuration>
            <executions>
              <execution>
                <goals>
                  <goal>testCompile</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-invoker-plugin</artifactId>
            <dependencies>
              <dependency>
                <groupId>org.codehaus.groovy</groupId>
                <artifactId>groovy</artifactId>
                <version>${org.codehaus.groovy-groovy.version}</version>
              </dependency>
              <dependency>
                <groupId>org.codehaus.gmaven.runtime</groupId>
                <artifactId>gmaven-runtime-1.8</artifactId>
                <version>${org.codehaus.gmaven.runtime-gmaven-runtime-1.8}</version>
              </dependency>
            </dependencies>
            <configuration>
              <addTestClassPath>true</addTestClassPath>
              <debug>false</debug>
              <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
              <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
              <projectsDirectory>src/it</projectsDirectory>
              <showVersion>false</showVersion>
              <setupIncludes>
                <setupInclude>setup/pom.xml</setupInclude>
              </setupIncludes>
              <pomIncludes>
                <pomInclude>*/pom.xml</pomInclude>
              </pomIncludes>
              <preBuildHookScript>setup</preBuildHookScript>
              <postBuildHookScript>verify</postBuildHookScript>
              <settingsFile>src/it/settings.xml</settingsFile>
              <!-- Currently working with more than one thread does not work, cause it is not guaranteed that the setup-config project
                is build at first. see also http://jira.codehaus.org/browse/MINVOKER-147 -->
              <parallelThreads>1</parallelThreads>
            </configuration>
            <executions>
              <execution>
                <id>pre-integration-tests</id>
                <goals>
                  <goal>install</goal>
                </goals>
                <configuration>
                  <extraArtifacts>
                    <extraArtifact>org.hamcrest:hamcrest-core:1.3:jar</extraArtifact>
                    <extraArtifact>junit:junit:4.8:jar</extraArtifact>
                    <extraArtifact>org.codehaus.mojo:exec-maven-plugin:1.4.0:maven-plugin</extraArtifact>

                    <extraArtifact>org.apache.maven.surefire:surefire-junit4:2.18.1:jar</extraArtifact>
                    <extraArtifact>org.apache.maven.plugins:maven-compiler-plugin:3.2:maven-plugin</extraArtifact>
                    <extraArtifact>org.apache.maven.plugins:maven-install-plugin:2.5.2:maven-plugin</extraArtifact>
                    <extraArtifact>org.apache.maven.plugins:maven-clean-plugin:2.6.1:maven-plugin</extraArtifact>
                    <extraArtifact>org.apache.maven.plugins:maven-surefire-plugin:2.18.1:maven-plugin</extraArtifact>
                    <extraArtifact>org.apache.maven.plugins:maven-assembly-plugin:2.5.2:maven-plugin</extraArtifact>
                    <extraArtifact>org.apache.maven.plugins:maven-jar-plugin:2.5:maven-plugin</extraArtifact>
                    <extraArtifact>org.apache.maven.plugins:maven-war-plugin:2.5:maven-plugin</extraArtifact>
                    <extraArtifact>org.apache.maven.plugins:maven-resources-plugin:2.7:maven-plugin</extraArtifact>
                    <extraArtifact>org.apache.maven.plugins:maven-site-plugin:3.3:maven-plugin</extraArtifact>
                    <extraArtifact>org.apache.maven.wagon:wagon-ssh:2.4:jar</extraArtifact>
                    <extraArtifact>org.codehaus.plexus:plexus-utils:1.1:jar</extraArtifact>
                    <extraArtifact>com.soebes.smpp:smpp:0.7.0:pom</extraArtifact>
                    <extraArtifact>com.soebes.maven.plugins:maven-echo-plugin:0.1:maven-plugin</extraArtifact>
                    <extraArtifact>org.apache.commons:commons-lang3:3.4:jar</extraArtifact>
                  </extraArtifacts>
                </configuration>
              </execution>
              <execution>
                <id>integration-tests</id>
                <goals>
                  <goal>run</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
      <reporting>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-invoker-plugin</artifactId>
          </plugin>
        </plugins>
      </reporting>
    </profile>

  </profiles>


</project>
