<?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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>org.apache.maven.surefire</groupId>
    <artifactId>surefire</artifactId>
    <version>2.6-MULE-2</version>
    <relativePath>../pom.xml</relativePath>
  </parent>

  <groupId>org.apache.maven.surefire</groupId>
  <artifactId>surefire-integration-tests</artifactId>

  <name>Maven Surefire Integration Tests</name>

  <dependencies>
    <!-- DGF Depend on the SurefireReportParser -->
    <dependency>
      <artifactId>maven-surefire-report-plugin</artifactId>
      <groupId>org.apache.maven.plugins</groupId>
      <version>${project.version}</version>
      <type>maven-plugin</type>
    </dependency>
   <dependency>
      <artifactId>maven-surefire-plugin</artifactId>
      <groupId>org.apache.maven.plugins</groupId>
      <version>${project.version}</version>
      <type>maven-plugin</type>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.surefire</groupId>
      <artifactId>surefire-testng</artifactId>
      <version>${project.version}</version>
      <exclusions>
        <!-- SC don't want our surefire getting confulsed and trying to use the testng runner -->
        <exclusion>
          <groupId>org.testng</groupId>
          <artifactId>testng</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.surefire</groupId>
      <artifactId>surefire-junit</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.surefire</groupId>
      <artifactId>surefire-junit4</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.surefire</groupId>
      <artifactId>surefire-junit47</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.shared</groupId>
      <artifactId>maven-verifier</artifactId>
      <version>1.2</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-settings</artifactId>
      <version>2.0.6</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-help-plugin</artifactId>
        <version>2.1</version>
        <executions>
          <execution>
            <id>settings.xml</id>
            <phase>generate-test-resources</phase>
            <goals>
              <goal>effective-settings</goal>
            </goals>
            <configuration>
              <output>${project.build.directory}/private/settings.xml</output>
              <showPasswords>${it.settings.showPasswords}</showPasswords>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-invoker-plugin</artifactId>
        <version>1.5</version>
        <executions>
          <execution>
            <goals>
              <goal>install</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <test>SetUpForIntegrationTest</test>
          
          <!-- Pass current surefire version to the main suite so that it -->
          <!-- can forward to all integration test projects. SUREFIRE-513 -->
          <systemProperties>
            <property>
              <name>surefire.version</name>
              <value>${project.version}</value>
            </property>
            <property>
              <name>maven.home</name>
              <value>${maven.home}</value>
            </property>
            <property>
              <name>maven.settings.file</name>
              <value>${project.build.directory}/private/settings.xml</value>
            </property>
            <property>
              <name>maven.staged.local.repo</name>
              <value>${project.build.directory}/it-repo</value>
            </property>
          </systemProperties>

        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-failsafe-plugin</artifactId>
        <version>2.5</version>
        <configuration>
          <!-- Pass current surefire version to the main suite so that it -->
          <!-- can forward to all integration test projects. SUREFIRE-513 -->
          <systemProperties>
            <property>
              <name>surefire.version</name>
              <value>${project.version}</value>
            </property>
            <property>
              <name>maven.home</name>
              <value>${maven.home}</value>
            </property>
            <property>
              <name>maven.settings.file</name>
              <value>${project.build.directory}/private/settings.xml</value>
            </property>
            <property>
              <name>maven.staged.local.repo</name>
              <value>${project.build.directory}/it-repo</value>
            </property>
          </systemProperties>

        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-enforcer-plugin</artifactId>
        <executions>
          <execution>
            <id>require-maven-2.1.0</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireMavenVersion>
                  <!-- Some plugin features require a recent Maven runtime to work (e.g. SystemPropertiesTest) -->
                  <version>[2.1.0,)</version>
                </requireMavenVersion>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  
  <properties>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <it.settings.showPasswords>false</it.settings.showPasswords>
  </properties>
</project>
