<?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>io.hexaglue</groupId>
        <artifactId>hexaglue-parent</artifactId>
        <version>6.0.0</version>
    </parent>

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

    <name>HexaGlue Maven Plugin</name>
    <description>Maven plugin wrapper for HexaGlue - handles classpath and invokes the engine</description>

    <properties>
        <hexaglue.root>${project.basedir}/..</hexaglue.root>
        <maven-plugin-api.version>3.9.9</maven-plugin-api.version>
        <maven-plugin-annotations.version>3.15.0</maven-plugin-annotations.version>
        <maven-core.version>3.9.9</maven-core.version>
    </properties>

    <dependencies>
        <!-- Internal -->
        <dependency>
            <groupId>io.hexaglue</groupId>
            <artifactId>hexaglue-core</artifactId>
        </dependency>
        <dependency>
            <groupId>io.hexaglue</groupId>
            <artifactId>hexaglue-spi</artifactId>
        </dependency>

        <!-- YAML support for classification profiles (optional in core, required here) -->
        <dependency>
            <groupId>org.yaml</groupId>
            <artifactId>snakeyaml</artifactId>
        </dependency>

        <!-- Maven Plugin API -->
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-plugin-api</artifactId>
            <version>${maven-plugin-api.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.maven.plugin-tools</groupId>
            <artifactId>maven-plugin-annotations</artifactId>
            <version>${maven-plugin-annotations.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-core</artifactId>
            <version>${maven-core.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-model</artifactId>
            <version>${maven-core.version}</version>
            <scope>provided</scope>
        </dependency>

        <!-- Test dependencies -->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-plugin-plugin</artifactId>
                <configuration>
                    <goalPrefix>hexaglue</goalPrefix>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-invoker-plugin</artifactId>
                <version>3.8.0</version>
                <configuration>
                    <projectsDirectory>src/it</projectsDirectory>
                    <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
                    <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
                    <settingsFile>src/it/settings.xml</settingsFile>
                    <pomIncludes>
                        <pomInclude>*/pom.xml</pomInclude>
                    </pomIncludes>
                    <postBuildHookScript>verify</postBuildHookScript>
                    <goals>
                        <goal>clean</goal>
                        <goal>compile</goal>
                    </goals>
                    <streamLogs>true</streamLogs>
                </configuration>
                <executions>
                    <execution>
                        <id>integration-test</id>
                        <goals>
                            <goal>install</goal>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>
