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

     Copyright 2005-2016 Red Hat, Inc.

     Red Hat licenses this file to you 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">
    <parent>
        <artifactId>components</artifactId>
        <groupId>io.fabric8</groupId>
        <version>2.2.192</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <groupId>io.fabric8</groupId>
    <artifactId>fabric8-springboot</artifactId>
    <name>Fabric8 :: Spring Boot</name>


    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>${spring.boot.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>io.fabric8</groupId>
            <artifactId>kubernetes-api</artifactId>
        </dependency>
        <dependency>
            <groupId>io.fabric8</groupId>
            <artifactId>kubernetes-client</artifactId>
        </dependency>
        <dependency>
            <groupId>io.fabric8</groupId>
            <artifactId>fabric8-annotations</artifactId>
        </dependency>
        <dependency>
            <groupId>io.fabric8</groupId>
            <artifactId>fabric8-utils</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.dataformat</groupId>
            <artifactId>jackson-dataformat-yaml</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>org.reflections</groupId>
            <artifactId>reflections</artifactId>
            <version>${reflections.version}</version>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>io.fabric8</groupId>
            <artifactId>mockwebserver</artifactId>
            <version>${mockwebserver.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>io.fabric8</groupId>
            <artifactId>kubernetes-client</artifactId>
            <version>${kubernetes-client.version}</version>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>io.fabric8</groupId>
            <artifactId>openshift-client</artifactId>
            <version>${kubernetes-client.version}</version>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.5</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>test-jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven-surefire-plugin.version}</version>
                <configuration>
                    <!--
                      Skip tests by default. Will be using different executions
                      setup to run different set of tests with different
                      configurations
                    -->
                    <skip>true</skip>
                    <!-- other default configuration for all the tests, just an example -->
                    <reportFormat>plain</reportFormat>
                    <forkCount>1</forkCount>
                    <reuseForks>false</reuseForks>
                </configuration>
                <executions>
                    <execution>
                        <id>internal-test</id>
                        <phase>test</phase>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <configuration>
                            <skip>false</skip>
                            <!-- We cleanup system properties an env vars, so that we can test in a predictable env -->
                            <environmentVariables>
                                <HOSTNAME>dummyhost</HOSTNAME>
                                <KUBERNETES_SERVICE_HOST>dummyhost</KUBERNETES_SERVICE_HOST>
                                <KUBERNETES_SERVICE_PORT>8080</KUBERNETES_SERVICE_PORT>
                                <SERVICE1_SERVICE_HOST>dummyhost1</SERVICE1_SERVICE_HOST>
                                <SERVICE1_SERVICE_PORT>8081</SERVICE1_SERVICE_PORT>
                                <SERVICE2_SERVICE_HOST>dummyhost2</SERVICE2_SERVICE_HOST>
                                <SERVICE2_SERVICE_PORT>8082</SERVICE2_SERVICE_PORT>
                                <SERVICE3_SERVICE_HOST>dummyhost3</SERVICE3_SERVICE_HOST>
                                <SERVICE3_SERVICE_PORT>8083</SERVICE3_SERVICE_PORT>
                                <MULTIPORT_SERVICE_HOST>dummyhost3</MULTIPORT_SERVICE_HOST>
                                <MULTIPORT_SERVICE_PORT>8081</MULTIPORT_SERVICE_PORT>
                                <MULTIPORT_SERVICE_PORT_PORT1>8081</MULTIPORT_SERVICE_PORT_PORT1>
                                <MULTIPORT_SERVICE_PORT_PORT2>8082</MULTIPORT_SERVICE_PORT_PORT2>
                                <MULTIPORT_SERVICE_PORT_PORT3>8083</MULTIPORT_SERVICE_PORT_PORT3>
                            </environmentVariables>
                            <includes>
                                <include>**/*InternalTest.java</include>
                            </includes>
                        </configuration>
                    </execution>
                    <execution>
                        <id>external-test</id>
                        <phase>test</phase>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <configuration>
                            <skip>false</skip>
                            <!-- We cleanup system properties an env vars, so that we can test in a predictable env -->
                            <environmentVariables>
                                <HOSTNAME></HOSTNAME>
                                <KUBERNETES_SERVICE_HOST></KUBERNETES_SERVICE_HOST>
                                <KUBERNETES_SERVICE_PORT></KUBERNETES_SERVICE_PORT>
                            </environmentVariables>
                            <includes>
                                <include>**/*ExternalTest.java</include>
                            </includes>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
