<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>org.jenkins-ci.plugins</groupId>
    <artifactId>plugin</artifactId>
    <version>3.0</version>
  </parent>

  <groupId>org.csanchez.jenkins.plugins</groupId>
  <artifactId>kubernetes</artifactId>
  <version>1.6.0</version>
  <name>Kubernetes plugin</name>
  <description>Jenkins plugin to run dynamic agents in a Kubernetes cluster</description>
  <packaging>hpi</packaging>
  <url>https://wiki.jenkins-ci.org/display/JENKINS/Kubernetes+Plugin</url>

  <scm>
    <connection>scm:git:ssh://git@github.com/jenkinsci/kubernetes-plugin.git</connection>
    <developerConnection>scm:git:ssh://git@github.com/jenkinsci/kubernetes-plugin.git</developerConnection>
    <url>https://github.com/jenkinsci/kubernetes-plugin</url>
    <tag>kubernetes-1.6.0</tag>
  </scm>

  <licenses>
    <license>
      <name>Apache License 2.0</name>
      <url>https://www.apache.org/licenses/LICENSE-2.0</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <developers>
    <developer>
      <id>carlos</id>
      <name>Carlos Sanchez</name>
      <email>carlos@apache.org</email>
    </developer>
  </developers>

  <properties>
    <!-- in minikube
    minikube ip | sed -e 's/\([0-9]*\.[0-9]*\.[0-9]*\).*/\1.1/' -->
    <connectorHost>192.168.64.1</connectorHost>
    <java.level>8</java.level>

    <!-- dependency versions -->
    <httpclient.version>4.5.1</httpclient.version>
    <jackson.version>2.5.0</jackson.version>
    <jenkins.version>2.32.1</jenkins.version>

    <kubernetes-client.version>3.1.10</kubernetes-client.version>

    <!-- jenkins plugins versions -->
    <jenkins-basic-steps.version>2.3</jenkins-basic-steps.version>
    <jenkins-credentials.version>2.1.11</jenkins-credentials.version>
    <jenkins-kubernetes-credentials.version>0.3.0</jenkins-kubernetes-credentials.version>
    <jenkins-durable-task.version>1.16</jenkins-durable-task.version>
    <jenkins-durable-task-step.version>2.11</jenkins-durable-task-step.version>
    <jenkins-structs.version>1.6</jenkins-structs.version>
    <jenkins-workflow-cps.version>2.29</jenkins-workflow-cps.version>
    <jenkins-workflow-job.version>2.9</jenkins-workflow-job.version>
    <jenkins-workflow-step-api.version>2.11</jenkins-workflow-step-api.version>
    <jenkins-workflow-support.version>2.14</jenkins-workflow-support.version>
    <jenkins-workflow-api.version>2.11</jenkins-workflow-api.version>
    <jenkins-workflow-scm-step.version>2.4</jenkins-workflow-scm-step.version>
    <jenkins-scm-api.version>2.0.7</jenkins-scm-api.version>
    <jenkins-declarative.version>1.1.2</jenkins-declarative.version>
    <jenkins-script-security.version>1.26</jenkins-script-security.version>

  </properties>

  <dependencies>
    <dependency>
      <groupId>io.fabric8</groupId>
      <artifactId>kubernetes-client</artifactId>
      <version>${kubernetes-client.version}</version>
    </dependency>

    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpclient</artifactId>
      <version>${httpclient.version}</version>
    </dependency>

    <!-- required plugins -->
    <dependency>
      <groupId>org.jenkinsci.plugins</groupId>
      <artifactId>kubernetes-credentials</artifactId>
      <version>${jenkins-kubernetes-credentials.version}</version>
    </dependency>

    <dependency> <!-- OnceRetentionStrategy -->
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>durable-task</artifactId>
      <version>${jenkins-durable-task.version}</version>
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>variant</artifactId>
      <version>1.0</version>
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.plugins.workflow</groupId>
      <artifactId>workflow-step-api</artifactId>
      <version>${jenkins-workflow-step-api.version}</version>
    </dependency>
    <dependency> <!-- DeclarativeAgent -->
      <groupId>org.jenkinsci.plugins</groupId>
      <artifactId>pipeline-model-extensions</artifactId>
      <version>${jenkins-declarative.version}</version>
      <optional>true</optional>
    </dependency>

    <!-- for testing -->
    <dependency>
      <groupId>org.jenkins-ci.plugins.workflow</groupId>
      <artifactId>workflow-job</artifactId>
      <version>${jenkins-workflow-job.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.plugins.workflow</groupId>
      <artifactId>workflow-basic-steps</artifactId>
      <version>${jenkins-basic-steps.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency> <!-- StepConfigTester -->
      <groupId>org.jenkins-ci.plugins.workflow</groupId>
      <artifactId>workflow-step-api</artifactId>
      <version>${jenkins-workflow-step-api.version}</version>
      <classifier>tests</classifier>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.plugins.workflow</groupId>
      <artifactId>workflow-support</artifactId>
      <version>${jenkins-workflow-support.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.plugins.workflow</groupId>
      <artifactId>workflow-durable-task-step</artifactId>
      <version>${jenkins-durable-task-step.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency> <!-- SemaphoreStep -->
      <groupId>org.jenkins-ci.plugins.workflow</groupId>
      <artifactId>workflow-support</artifactId>
      <version>${jenkins-workflow-support.version}</version>
      <classifier>tests</classifier>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.plugins.workflow</groupId>
      <artifactId>workflow-scm-step</artifactId>
      <version>${jenkins-workflow-scm-step.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>scm-api</artifactId>
      <version>${jenkins-scm-api.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jenkinsci.plugins</groupId>
      <artifactId>pipeline-model-definition</artifactId>
      <version>${jenkins-declarative.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.plugins.workflow</groupId>
      <artifactId>workflow-api</artifactId>
      <version>${jenkins-workflow-api.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.plugins.workflow</groupId>
      <artifactId>workflow-cps</artifactId>
      <version>${jenkins-workflow-cps.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <version>2.9.0</version>
      <scope>test</scope>
    </dependency>

    <!-- for ContainerExecDecoratorPipelineTest -->
    <dependency>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>ssh-agent</artifactId>
      <version>1.15</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>bouncycastle-api</artifactId>
      <version>2.16.2</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.jenkins-ci.plugins</groupId>
        <artifactId>credentials</artifactId>
        <version>${jenkins-credentials.version}</version>
      </dependency>

      <!-- just to fix enforcer RequireUpperBoundDeps -->
      <dependency>
        <groupId>org.jenkins-ci.plugins</groupId>
        <artifactId>structs</artifactId>
        <version>${jenkins-structs.version}</version>
      </dependency>
      <dependency>
        <groupId>org.jenkins-ci.plugins</groupId>
        <artifactId>ssh-credentials</artifactId>
        <version>1.12</version>
      </dependency>
      <dependency>
        <groupId>org.apache.sshd</groupId>
        <artifactId>sshd-core</artifactId>
        <version>1.6.0</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <systemPropertyVariables>
            <hudson.slaves.NodeProvisioner.initialDelay>0</hudson.slaves.NodeProvisioner.initialDelay>
            <hudson.slaves.NodeProvisioner.MARGIN>50</hudson.slaves.NodeProvisioner.MARGIN>
            <hudson.slaves.NodeProvisioner.MARGIN0>0.85</hudson.slaves.NodeProvisioner.MARGIN0>
            <!-- listen in this interface for connections from kubernetes pods -->
            <connectorHost>${connectorHost}</connectorHost>
          </systemPropertyVariables>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.jenkins-ci.tools</groupId>
        <artifactId>maven-hpi-plugin</artifactId>
        <configuration>
          <!-- with the default setting seems that an older version of jackson from core is used
            java.lang.NoSuchMethodError: com.fasterxml.jackson.core.JsonFactory.requiresPropertyOrdering()Z
            at com.fasterxml.jackson.databind.ObjectMapper.<init>(ObjectMapper.java:549)
            at com.fasterxml.jackson.databind.ObjectMapper.<init>(ObjectMapper.java:460)
            at io.fabric8.kubernetes.client.utils.Serialization.<clinit>(Serialization.java:37)
          -->
          <pluginFirstClassLoader>true</pluginFirstClassLoader>
          <systemProperties>
            <hudson.slaves.NodeProvisioner.initialDelay>0</hudson.slaves.NodeProvisioner.initialDelay>
            <hudson.slaves.NodeProvisioner.MARGIN>50</hudson.slaves.NodeProvisioner.MARGIN>
            <hudson.slaves.NodeProvisioner.MARGIN0>0.85</hudson.slaves.NodeProvisioner.MARGIN0>
          </systemProperties>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <!-- get every artifact through repo.jenkins-ci.org, which proxies all the artifacts that we need -->
  <repositories>
    <repository>
      <id>repo.jenkins-ci.org</id>
      <url>https://repo.jenkins-ci.org/public/</url>
    </repository>
  </repositories>

  <pluginRepositories>
    <pluginRepository>
      <id>repo.jenkins-ci.org</id>
      <url>https://repo.jenkins-ci.org/public/</url>
    </pluginRepository>
  </pluginRepositories>

</project>
