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

     Copyright 2005-2015 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.98</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>fabric8-cdi</artifactId>
    <name>Fabric8 :: CDI</name>

    <dependencies>
        <dependency>
            <groupId>io.fabric8</groupId>
            <artifactId>fabric8-annotations</artifactId>
        </dependency>
        <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-utils</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.dataformat</groupId>
            <artifactId>jackson-dataformat-yaml</artifactId>
        </dependency>
        <dependency>
            <groupId>javax.enterprise</groupId>
            <artifactId>cdi-api</artifactId>
            <version>1.2</version>
        </dependency>

        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-api</artifactId>
            <version>7.0</version>
        </dependency>

        <dependency>
            <groupId>org.apache.deltaspike.core</groupId>
            <artifactId>deltaspike-core-api</artifactId>
            <version>${deltaspike.version}</version>
        </dependency>
        
        <dependency>
            <groupId>org.apache.deltaspike.core</groupId>
            <artifactId>deltaspike-core-impl</artifactId>
            <version>${deltaspike.version}</version>
        </dependency>

        <dependency>
            <groupId>org.codehaus.plexus</groupId>
            <artifactId>plexus-utils</artifactId>
        </dependency>

        <dependency>
            <groupId>org.jboss.weld</groupId>
            <artifactId>weld-core</artifactId>
            <version>${weld.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.jboss.weld.se</groupId>
            <artifactId>weld-se</artifactId>
            <version>${weld.version}</version>
            <scope>test</scope>
        </dependency>
        
        <dependency>
            <groupId>org.jboss.arquillian.container</groupId>
            <artifactId>arquillian-weld-ee-embedded-1.1</artifactId>
            <version>1.0.0.CR9</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.jboss.shrinkwrap.resolver</groupId>
            <artifactId>shrinkwrap-resolver-impl-maven</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>io.fabric8</groupId>
            <artifactId>openshift-mock</artifactId>
            <scope>test</scope>
        </dependency>
        
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        
        <dependency>
            <groupId>org.jboss.arquillian.junit</groupId>
            <artifactId>arquillian-junit-container</artifactId>
            <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>
                                <CONFIG1_TEST>value1</CONFIG1_TEST>
                                <CONFIG2_TEST>value2</CONFIG2_TEST>
                                <KUBERNETES_NAMESPACE>default</KUBERNETES_NAMESPACE>
                                <KUBERNETES_SERVICE_HOST>dummyhost</KUBERNETES_SERVICE_HOST>
                                <KUBERNETES_SERVICE_PORT>8080</KUBERNETES_SERVICE_PORT>
                                <SERVICE1_PRTOTOCOL>https</SERVICE1_PRTOTOCOL>
                                <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_PRTOTOCOL>https</SERVICE3_PRTOTOCOL>
                                <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_NAMESPACE>default</KUBERNETES_NAMESPACE>
                                <KUBERNETES_SERVICE_HOST></KUBERNETES_SERVICE_HOST>
                                <KUBERNETES_SERVICE_PORT></KUBERNETES_SERVICE_PORT>
                            </environmentVariables>
                            <includes>
                                <include>**/*ExternalTest.java</include>
                            </includes>
                        </configuration>
                    </execution>
                    <execution>
                        <id>no-namespace-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_NAMESPACE></KUBERNETES_NAMESPACE>
                                <KUBERNETES_AUTH_TRYKUBECONFIG>false</KUBERNETES_AUTH_TRYKUBECONFIG>
                                <KUBERNETES_AUTH_TRYKUBESERVICEACCCOUNT>false</KUBERNETES_AUTH_TRYKUBESERVICEACCCOUNT>
                            </environmentVariables>
                            <includes>
                                <include>**/*NoNamespaceTest.java</include>
                            </includes>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
