<?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>org.emergent.gittle</groupId>
    <artifactId>gittle-parent</artifactId>
    <version>0.0.1</version>
  </parent>

  <artifactId>gittle-maven-extension</artifactId>

  <name>Gittle Maven Extension</name>

  <dependencies>
    <dependency>
      <groupId>com.google.code.gson</groupId>
      <artifactId>gson</artifactId>
    </dependency>
    <dependency>
      <groupId>org.emergent.gittle</groupId>
      <artifactId>gittle-core</artifactId>
      <version>${project.version}</version>
      <exclusions>
        <!-- must be 'provided' scope here -->
        <exclusion>
          <groupId>org.apache.maven</groupId>
          <artifactId>maven-artifact</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
    </dependency>
    <dependency>
      <groupId>javax.inject</groupId>
      <artifactId>javax.inject</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-artifact</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-builder-support</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-core</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-model</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-model-builder</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.shared</groupId>
      <artifactId>maven-shared-utils</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.codehaus.plexus</groupId>
      <artifactId>plexus-utils</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.eclipse.sisu</groupId>
      <artifactId>org.eclipse.sisu.inject</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.projectlombok</groupId>
      <artifactId>lombok</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jgit</groupId>
      <artifactId>org.eclipse.jgit</artifactId>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.shared</groupId>
      <artifactId>maven-verifier</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <profiles>
    <profile>
      <id>run-its</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
            <configuration>
              <environmentVariables>
                <HOME>${project.build.testOutputDirectory}/home</HOME>
              </environmentVariables>
              <systemPropertyVariables>
                <user.home>${project.build.testOutputDirectory}/home</user.home>
                <maven.repo.local>${project.build.directory}/local-failsafe-repo</maven.repo.local>
              </systemPropertyVariables>
            </configuration>
            <executions>
              <execution>
                <goals>
                  <goal>integration-test</goal>
                  <goal>verify</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-invoker-plugin</artifactId>
            <executions>
              <execution>
                <id>failsafe-prep</id>
                <goals>
                  <goal>install</goal>
                </goals>
                <configuration>
                  <scope>test</scope>
                  <localRepositoryPath>${project.build.directory}/local-failsafe-repo</localRepositoryPath>
                </configuration>
              </execution>
              <execution>
                <id>integration-test</id>
                <goals>
                  <goal>install</goal>
                  <goal>integration-test</goal>
                  <goal>verify</goal>
                </goals>
                <configuration>
                  <goals>
                    <goal>-ntp</goal>
                    <goal>verify</goal>
                  </goals>
                  <pomIncludes>
                    <pomInclude>*/pom.xml</pomInclude>
                  </pomIncludes>
                  <scope>runtime</scope>
                  <cloneClean>true</cloneClean>
                  <showErrors>true</showErrors>
                  <streamLogsOnFailures>true</streamLogsOnFailures>
                  <timeoutInSeconds>60</timeoutInSeconds>
                  <preBuildHookScript>setup</preBuildHookScript>
                  <postBuildHookScript>verify</postBuildHookScript>
                  <settingsFile>src/it/settings.xml</settingsFile>
                  <cloneProjectsTo>${project.build.directory}/its</cloneProjectsTo>
                  <localRepositoryPath>${project.build.directory}/local-invoker-home/repo</localRepositoryPath>
                  <environmentVariables>
                    <HOME>${project.build.directory}/local-invoker-home</HOME>
                  </environmentVariables>
                  <properties>
                    <user.home>${project.build.directory}/local-invoker-home</user.home>
                  </properties>
                  <extraArtifacts>
                    <artifact>junit:junit:3.8.1</artifact>
                  </extraArtifacts>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
