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

    <parent>
        <groupId>com.atlassian.amps</groupId>
        <artifactId>atlassian-amps-parent</artifactId>
        <version>8.2.3-CONFSRVDEV-20193-m21</version>
    </parent>

    <artifactId>maven-3-tests</artifactId>
    <packaging>pom</packaging>

    <name>Maven 3 Tests</name>
    <description>Integration tests of AMPS itself.</description>

    <dependencies>
        <!-- This dependency is here to ensure the EcoBAC AMPS build for this module, which uses -am, builds
             amps-maven-plugin before it tries to run tests against it -->
        <dependency>
            <groupId>com.atlassian.maven.plugins</groupId>
            <artifactId>amps-maven-plugin</artifactId>
            <type>maven-plugin</type>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>unpack</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>org.apache.maven</groupId>
                                    <artifactId>apache-maven</artifactId>
                                    <version>${bundled.maven.version}</version>
                                    <type>tar.gz</type>
                                    <classifier>bin</classifier>
                                    <outputDirectory>${project.build.directory}</outputDirectory>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>invoker</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-invoker-plugin</artifactId>
                        <configuration>
                            <mavenHome>${project.build.directory}/apache-maven-${bundled.maven.version}</mavenHome>
                            <cloneProjectsTo>${project.build.directory}/its</cloneProjectsTo>
                            <localRepositoryPath>${root.dir}/invoker-repo</localRepositoryPath>
                            <settingsFile>src/it/settings.xml</settingsFile>
                            <pomIncludes>
                                <pomInclude>*</pomInclude>
                            </pomIncludes>
                        </configuration>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>install</goal>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>build-helper-maven-plugin</artifactId>
                        <version>3.0.0</version>
                        <executions>
                            <execution>
                                <id>set-root-dir</id>
                                <goals>
                                    <goal>rootlocation</goal>
                                </goals>
                                <configuration>
                                    <rootLocationProperty>root.dir</rootLocationProperty>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
