<?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.codingmatters.poom.ci</groupId>
        <artifactId>poom-ci</artifactId>
        <version>1.1.0</version>
    </parent>

    <artifactId>poom-ci-pipeline-api</artifactId>
    <name>${project.groupId}:${project.artifactId}</name>

    <dependencies>
        <dependency>
            <groupId>org.codingmatters.poom.ci</groupId>
            <artifactId>poom-ci-pipeline-api-spec</artifactId>
        </dependency>
        <dependency>
            <groupId>org.codingmatters.poom.ci</groupId>
            <artifactId>poom-ci-triggers</artifactId>
        </dependency>

        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.codingmatters.value.objects</groupId>
            <artifactId>cdm-value-objects-values</artifactId>
        </dependency>
    </dependencies>

    <build>
        <plugins>

            <plugin>
                <groupId>org.codingmatters.rest</groupId>
                <artifactId>cdm-rest-maven-plugin</artifactId>
                <dependencies>
                    <dependency>
                        <groupId>${project.groupId}</groupId>
                        <artifactId>poom-ci-pipeline-api-spec</artifactId>
                        <version>${project.version}</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <id>api-types-gen</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>generate-api-types</goal>
                        </goals>
                        <configuration>
                            <destination-package>${project.groupId}.pipeline.api</destination-package>
                            <api-spec-resource>poom-ci-pipeline-api.raml</api-spec-resource>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>target/generated-sources</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>