<?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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>io.fabric8</groupId>
    <artifactId>components</artifactId>
    <version>2.3.7</version>
  </parent>

  <artifactId>kubernetes-api</artifactId>
  <packaging>bundle</packaging>
  <name>Fabric8 :: Kubernetes :: API</name>

  <dependencies>

    <dependency>
      <groupId>javax.validation</groupId>
      <artifactId>validation-api</artifactId>
      <version>${validation-api.version}</version>
    </dependency>

    <dependency>
      <groupId>io.fabric8</groupId>
      <artifactId>openshift-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>org.json</groupId>
      <artifactId>json</artifactId>
    </dependency>

    <dependency>
      <groupId>dnsjava</groupId>
      <artifactId>dnsjava</artifactId>
    </dependency>

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
    </dependency>

      <!-- testing -->
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
      <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>
    <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>mockwebserver</artifactId>
      <version>${mockwebserver.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>${exec-maven-plugin.version}</version>
        <executions>
          <execution>
            <goals>
              <goal>java</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <mainClass>io.fabric8.kubernetes.api.Example</mainClass>
          <classpathScope>test</classpathScope>
        </configuration>
      </plugin>
    </plugins>
  </build>


  <profiles>
    <profile>
      <id>trigger</id>
      <properties>
        <build>console-build</build>
      </properties>

      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>${exec-maven-plugin.version}</version>
            <executions>
              <execution>
                <goals>
                  <goal>exec</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <executable>java</executable>
              <classpathScope>test</classpathScope>

              <!-- TODO for some reason this fails when running inside maven - wacky! -->
              <arguments>
                <argument>-classpath</argument>
                <classpath />
                <argument>io.fabric8.kubernetes.api.TriggerBuild</argument>
                <argument>${project.build}</argument>
              </arguments>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>pipeline-cfg</id>
      <build>
        <defaultGoal>test-compile exec:java</defaultGoal>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>${exec-maven-plugin.version}</version>
            <executions>
              <execution>
                <goals>
                  <goal>java</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <mainClass>io.fabric8.kubernetes.api.pipelines.ViewPipelineConfiguration</mainClass>
              <classpathScope>test</classpathScope>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>list-env</id>
      <build>
        <defaultGoal>test-compile exec:java</defaultGoal>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>${exec-maven-plugin.version}</version>
            <executions>
              <execution>
                <goals>
                  <goal>java</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <mainClass>io.fabric8.kubernetes.api.environments.ListEnvironments</mainClass>
              <classpathScope>test</classpathScope>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
