<?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.flexio.commons</groupId>
        <artifactId>flexio-commons</artifactId>
        <version>1.4.0</version>
        <relativePath>../</relativePath>
    </parent>

    <artifactId>flexio-docker-client</artifactId>

    <name>${project.groupId}:${project.artifactId}</name>

    <dependencies>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.codingmatters.rest</groupId>
            <artifactId>cdm-rest-client-api</artifactId>
        </dependency>

        <dependency>
            <groupId>org.codingmatters.rest</groupId>
            <artifactId>cdm-rest-client-okhttp</artifactId>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>compile</scope>
        </dependency>
    </dependencies>


    <build>
        <plugins>
            <plugin>
                <groupId>org.codingmatters.rest</groupId>
                <artifactId>cdm-rest-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>api-types-gen</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>generate-api-types</goal>
                        </goals>
                        <configuration>
                            <destination-package>io.flexio.docker.api</destination-package>
                            <api-spec-file>${project.basedir}/src/main/resources/docker-api.raml</api-spec-file>
                        </configuration>
                    </execution>

                    <execution>
                        <id>api-client-gen</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>generate-client-side</goal>
                        </goals>
                        <configuration>
                            <destination-package>io.flexio.docker.api.client</destination-package>
                            <api-spec-file>${project.basedir}/src/main/resources/docker-api.raml</api-spec-file>
                            <types-package>io.flexio.docker.api.types</types-package>
                            <api-package>io.flexio.docker.api</api-package>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.codingmatters.value.objects</groupId>
                <artifactId>cdm-value-objects-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>descriptors</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>generate</goal>
                            <goal>json</goal>
                        </goals>
                        <configuration>
                            <destination-package>io.flexio.docker.descriptors</destination-package>
                            <input-spec>src/main/resources/descriptors.yaml</input-spec>
                        </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>