<?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>3.0.0</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.8.6</version>
        </dependency>

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

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

        <dependency>
            <groupId>org.codehaus.plexus</groupId>
            <artifactId>plexus-utils</artifactId>
            <version>3.4.2</version>
        </dependency>

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

        <dependency>
            <groupId>com.github.rvesse</groupId>
            <artifactId>airline</artifactId>
            <version>${project.version}</version>
            <classifier>tests</classifier>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.github.rvesse</groupId>
            <artifactId>airline-examples</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-plugin-plugin</artifactId>
                <version>3.10.2</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>3.6.0</version>
                <configuration>
                    <localRepositoryPath>${project.build.directory}/it-repo</localRepositoryPath>
                    <postBuildHookScript>verify</postBuildHookScript>
                    <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
                    <mavenOpts>${invoker.mavenOpts} -Dhttps.protocols=TLSv1.2</mavenOpts>
                    <goals>clean,install</goals>
                    <failIfNoProjects>true</failIfNoProjects>
                    <skipInvocation>${skipTests}</skipInvocation>
                    <parallelThreads>4</parallelThreads>
                    <streamLogsOnFailures>true</streamLogsOnFailures>
                    <extraArtifacts>
                        <extraArtifact>com.github.rvesse:airline:${airline.version}:jar:tests</extraArtifact>
                        <extraArtifact>com.github.rvesse:airline-examples:${airline.version}:jar</extraArtifact>
                    </extraArtifacts>
                    <settingsFile>settings.xml</settingsFile>
                </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>
                            <append>true</append>
                        </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>
