<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->

<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.helidon.examples.webserver</groupId>
        <artifactId>helidon-examples-webserver-project</artifactId>
        <version>1.0.2-SNAPSHOT</version>
    </parent>
    <artifactId>helidon-examples-webserver-translator-frontend</artifactId>
    <name>Helidon WebServer Examples Translator Frontend</name>

    <description>
        A translator frontend example app.
    </description>

    <properties>
        <mainClass>io.helidon.webserver.examples.translator.frontend.Main</mainClass>

        <docker.image.name>${docker.registry}/skeppare/helidon/helidon-webserver-translator-frontend:${project.version}</docker.image.name>

        <docker.server.id>mic-docker-registry-automation</docker.server.id>
        <docker.registry>registry.oracledx.com</docker.registry>
        <docker.registry.url>https://${docker.registry}/v1/</docker.registry.url>
        <docker.maven.plugin.spotify.version>1.0.0</docker.maven.plugin.spotify.version>
        <docker.image.version></docker.image.version>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-docker-resources</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}/distribution/container</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>src/main/docker</directory>
                                    <filtering>true</filtering>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.spotify</groupId>
                <artifactId>docker-maven-plugin</artifactId>
                <configuration>
                    <serverId>${docker.server.id}</serverId>
                    <registryUrl>${docker.registry.url}</registryUrl>
                    <imageName>${docker.image.name}</imageName>
                    <dockerDirectory>${project.build.directory}/distribution/container</dockerDirectory>
                    <imageTags>
                        <imageTag>${docker.image.version}</imageTag>
                        <imageTag>latest</imageTag>
                    </imageTags>
                    <resources>
                        <resource>
                            <targetPath>/</targetPath>
                            <directory>${project.build.directory}</directory>
                            <include>${project.build.finalName}-fat.jar</include>
                        </resource>
                    </resources>
                </configuration>
            </plugin>
        </plugins>
        <pluginManagement>
            <plugins>
                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <configuration>
                        <systemPropertyVariables>
                            <java.util.logging.config.file>${project.build.outputDirectory}/logging.properties</java.util.logging.config.file>
                        </systemPropertyVariables>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <dependencies>
        <dependency>
            <groupId>io.helidon.webserver</groupId>
            <artifactId>helidon-webserver</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>io.helidon.webserver</groupId>
            <artifactId>helidon-webserver-jersey</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>io.helidon.tracing</groupId>
            <artifactId>helidon-tracing-jersey</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>io.helidon.tracing</groupId>
            <artifactId>helidon-tracing-zipkin</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>io.helidon.common</groupId>
            <artifactId>helidon-common</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>io.helidon.examples.webserver</groupId>
            <artifactId>helidon-examples-webserver-translator-backend</artifactId>
            <scope>test</scope>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-all</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.helidon.webserver</groupId>
            <artifactId>helidon-webserver-test-support</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>
