<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.tkit.onecx.quarkus</groupId>
        <artifactId>onecx-parameters-parent</artifactId>
        <version>1.7.0</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <artifactId>onecx-parameters-client</artifactId>
    <name>onecx-parameters-client</name>

    <dependencies>
        <dependency>
            <groupId>io.quarkiverse.openapi.generator</groupId>
            <artifactId>quarkus-openapi-generator</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-rest-client-jackson</artifactId>
        </dependency>
        <dependency>
            <groupId>org.tkit.quarkus.lib</groupId>
            <artifactId>tkit-quarkus-context</artifactId>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>io.quarkus</groupId>
                <artifactId>quarkus-maven-plugin</artifactId>
                <extensions>true</extensions>
                <executions>
                    <execution>
                        <goals>
                            <goal>build</goal>
                            <goal>generate-code</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <annotationProcessorPaths>
                        <path>
                            <groupId>io.quarkus</groupId>
                            <artifactId>quarkus-extension-processor</artifactId>
                            <version>${quarkus.version}</version>
                        </path>
                    </annotationProcessorPaths>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.googlecode.maven-download-plugin</groupId>
                <artifactId>download-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>parameters</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>wget</goal>
                        </goals>
                        <configuration>
                            <url>
                                https://raw.githubusercontent.com/onecx/onecx-parameter/main/openapi/onecx-parameter-v2.yaml
                            </url>
                            <outputDirectory>target/onecx/quarkus/parameters/openapi</outputDirectory>
                            <outputFileName>onecx-parameter-v2.yaml</outputFileName>
                            <skipCache>${download-maven-plugin.skip-cache}</skipCache>
                            <cacheDirectory>target/.cache</cacheDirectory>
                        </configuration>
                    </execution>
                    <execution>
                        <id>parameters-v1</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>wget</goal>
                        </goals>
                        <configuration>
                            <url>
                                https://raw.githubusercontent.com/onecx/onecx-parameter/main/openapi/onecx-parameter-v1.yaml
                            </url>
                            <outputDirectory>target/onecx/quarkus/parameters/openapi</outputDirectory>
                            <outputFileName>onecx-parameter-v1.yaml</outputFileName>
                            <skipCache>${download-maven-plugin.skip-cache}</skipCache>
                            <cacheDirectory>target/.cache</cacheDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>