<?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>
    <artifactId>airline-parent</artifactId>
    <groupId>com.github.rvesse</groupId>
    <version>2.8.3</version>
  </parent>

  <artifactId>airline-maven-plugin</artifactId>
  <packaging>maven-plugin</packaging>

  <name>Airline - Maven Plugin</name>

  <url>http://rvesse.github.io/airline/</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <license.header.path>${project.parent.basedir}</license.header.path>
    <coveralls.skip>true</coveralls.skip>

    <airline.version>${project.parent.version}</airline.version>
    <plugin.version>${project.version}</plugin.version>
  </properties>

  <dependencies>
    <dependency>
      <groupId>com.github.rvesse</groupId>
      <artifactId>airline</artifactId>
      <version>${project.parent.version}</version>
    </dependency>

    <dependency>
      <groupId>com.github.rvesse</groupId>
      <artifactId>airline-help-html</artifactId>
      <version>${project.parent.version}</version>
    </dependency>

    <dependency>
      <groupId>com.github.rvesse</groupId>
      <artifactId>airline-help-man</artifactId>
      <version>${project.parent.version}</version>
    </dependency>

    <dependency>
      <groupId>com.github.rvesse</groupId>
      <artifactId>airline-help-markdown</artifactId>
      <version>${project.parent.version}</version>
    </dependency>

    <dependency>
      <groupId>com.github.rvesse</groupId>
      <artifactId>airline-help-bash</artifactId>
      <version>${project.parent.version}</version>
    </dependency>

    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-core</artifactId>
      <version>3.2.1</version>
    </dependency>

    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-plugin-api</artifactId>
      <version>3.2.1</version>
    </dependency>

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

    <dependency>
      <groupId>org.codehaus.plexus</groupId>
      <artifactId>plexus-utils</artifactId>
      <version>3.0.18</version>
    </dependency>
    
    <dependency>
      <groupId>org.testng</groupId>
      <artifactId>testng</artifactId>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-plugin-plugin</artifactId>
        <version>3.5.1</version>
        <configuration>
          <goalPrefix>airline</goalPrefix>
          <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
        </configuration>
        <executions>
          <execution>
            <id>mojo-descriptor</id>
            <goals>
              <goal>descriptor</goal>
            </goals>
          </execution>
          <execution>
            <id>help-goal</id>
            <goals>
              <goal>helpmojo</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-invoker-plugin</artifactId>
        <version>2.0.0</version>
        <configuration>
          <debug>true</debug>
          <localRepositoryPath>${project.build.directory}/it-repo</localRepositoryPath>
          <postBuildHookScript>verify</postBuildHookScript>
	  <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
	  <mavenOpts>-Dhttps.protocols=TLSv1.2</mavenOpts>
          <goals>clean,install</goals>
        </configuration>
        <executions>
          <execution>
            <id>integration-test</id>
            <goals>
              <goal>install</goal>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>org.apache.maven.shared</groupId>
            <artifactId>maven-verifier</artifactId>
            <version>1.6</version>
          </dependency>
        </dependencies>
      </plugin>

      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>${plugin.jacoco}</version>
        <executions>
          <execution>
            <id>it-prepare-agent</id>
            <phase>pre-integration-test</phase>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
            <configuration>
              <destFile>${project.build.directory}/jacoco-it.exec</destFile>
              <propertyName>invoker.mavenOpts</propertyName>
            </configuration>
          </execution>
          <execution>
            <id>it-report</id>
            <phase>post-integration-test</phase>
            <goals>
              <goal>report</goal>
            </goals>
            <configuration>
              <dataFile>${project.build.directory}/jacoco-it.exec</dataFile>
              <outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>

    </plugins>
  </build>
</project>
