<?xml version="1.0" encoding="UTF-8"?>
<!--
 Copyright 2020 Google LLC

 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

        https://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>org.jenkins-ci.plugins</groupId>
    <artifactId>plugin</artifactId>
    <version>3.56</version>
    <relativePath/>
  </parent>

  <artifactId>google-compute-engine</artifactId>
  <version>4.3.0</version>
  <packaging>hpi</packaging>

  <name>Google Compute Engine Plugin</name>
  <description>This plugin allows Jenkins to provision dynamic worker nodes on Google Compute Engine.</description>
  <url>https://github.com/jenkinsci/google-compute-engine-plugin</url>
  <organization>
    <name>Google</name>
    <url>https://www.google.com</url>
  </organization>
  <licenses>
    <license>
      <name>Apache License, Version 2.0</name>
      <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <developers>
    <developer>
      <id>evanbrown</id>
      <name>Evan Brown</name>
      <email>evanbrown@google.com</email>
    </developer>
    <developer>
      <id>stephenshank</id>
      <name>Stephen Shank</name>
      <email>stephenshank@google.com</email>
    </developer>
    <developer>
      <id>craigbarber</id>
      <name>Craig Barber</name>
      <email>craigbarber@google.com</email>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:ssh://git@github.com/jenkinsci/google-compute-engine-plugin.git</connection>
    <developerConnection>scm:git:ssh://git@github.com/jenkinsci/google-compute-engine-plugin.git</developerConnection>
    <url>https://github.com/jenkinsci/google-compute-engine-plugin</url>
    <tag>google-compute-engine-4.3.0</tag>
  </scm>

  <properties>
    <jenkins.version>2.150.3</jenkins.version>
    <jenkinsRuleTimeout>0</jenkinsRuleTimeout>
    <java.level>8</java.level>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
    <skip.surefire.tests>${skipTests}</skip.surefire.tests>
    <skipITs>true</skipITs>
    <it.windows>false</it.windows>
    <configuration-as-code.version>1.35</configuration-as-code.version>
    <powershell.version>1.3</powershell.version>
    <google-oauth.version>1.0.0</google-oauth.version>
    <google.guava.version>20.0</google.guava.version>
    <google.http.version>1.34.2</google.http.version>
    <google.api.version>1.25.0</google.api.version>
    <compute.revision>214</compute.revision>
    <gcp-plugin-core.version>0.2.1</gcp-plugin-core.version>
    <hpi.compatibleSinceVersion>4.1.0</hpi.compatibleSinceVersion>
    <concurrency>10</concurrency>
    <it.runOrder>balanced</it.runOrder>
    <hamcrest.version>2.2</hamcrest.version>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>io.jenkins.tools.bom</groupId>
        <artifactId>bom-2.150.x</artifactId>
        <version>4</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <!-- Require upper bound dependencies -->
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>jcl-over-slf4j</artifactId>
        <version>1.7.26</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>log4j-over-slf4j</artifactId>
        <version>1.7.26</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>1.7.26</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-jdk14</artifactId>
        <version>1.7.26</version>
      </dependency>
    </dependencies>
  </dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>jsch</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>jackson2-api</artifactId>
      <version>2.10.2</version>
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>google-oauth-plugin</artifactId>
      <version>${google-oauth.version}</version>
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>ssh-credentials</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>credentials</artifactId>
    </dependency>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>${google.guava.version}</version>
    </dependency>
    <dependency>
      <groupId>com.google.http-client</groupId>
      <artifactId>google-http-client</artifactId>
      <version>${google.http.version}</version>
    </dependency>
    <dependency>
      <groupId>com.google.oauth-client</groupId>
      <artifactId>google-oauth-client</artifactId>
      <version>${google.api.version}</version>
      <exclusions>
        <exclusion>
          <groupId>com.google.http-client</groupId>
          <artifactId>google-http-client</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>com.google.apis</groupId>
      <artifactId>google-api-services-compute</artifactId>
      <version>v1-rev${compute.revision}-${google.api.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-text</artifactId>
      <version>1.7</version>
    </dependency>
    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <version>2.6</version>
    </dependency>
    <dependency>
      <groupId>com.google.cloud.graphite</groupId>
      <artifactId>gcp-client</artifactId>
      <version>${gcp-plugin-core.version}</version>
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>trilead-api</artifactId>
      <!-- Version can be removed when bumping the version for the BOM and
        https://github.com/jenkinsci/bom/pull/110/files get merged -->
      <version>1.0.3</version>
      <exclusions>
        <exclusion>
          <groupId>net.i2p.crypto</groupId>
          <artifactId>eddsa</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>net.i2p.crypto</groupId>
      <artifactId>eddsa</artifactId>
      <version>0.3.0</version>
    </dependency>
    <dependency>
      <groupId>org.awaitility</groupId>
      <artifactId>awaitility</artifactId>
      <version>3.1.6</version>
    </dependency>
    <dependency><!-- OnceRetentionStrategy -->
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>durable-task</artifactId>
    </dependency>
    <dependency>
      <groupId>org.projectlombok</groupId>
      <artifactId>lombok</artifactId>
      <version>1.18.6</version>
      <scope>provided</scope>
    </dependency>
    <!-- Test Dependencies -->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.12</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-library</artifactId>
      <version>${hamcrest.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-core</artifactId>
      <version>${hamcrest.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <version>2.23.4</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>plain-credentials</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.jenkins</groupId>
      <artifactId>configuration-as-code</artifactId>
      <version>${configuration-as-code.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.jenkins.configuration-as-code</groupId>
      <artifactId>test-harness</artifactId>
      <version>${configuration-as-code.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>powershell</artifactId>
      <version>${powershell.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <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>

  <build>
    <testResources>
      <testResource>
        <directory>src/test/resources</directory>
        <filtering>true</filtering>
      </testResource>
    </testResources>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>au.com.acegi</groupId>
        <artifactId>xml-format-maven-plugin</artifactId>
        <version>3.0.7</version>
        <executions>
          <execution>
            <id>validate</id>
            <phase>validate</phase>
            <goals>
              <goal>xml-format</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <includes>pom.xml</includes>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>tidy-maven-plugin</artifactId>
        <version>1.1.0</version>
        <executions>
          <execution>
            <id>validate</id>
            <phase>validate</phase>
            <goals>
              <goal>pom</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <configuration>
          <completionGoals>xml-format:xml-format tidy:pom</completionGoals>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <skipITs>${skipITs}</skipITs>
          <disableXmlReport>true</disableXmlReport>
          <useFile>false</useFile>
          <systemPropertyVariables>
            <hudson.model.LoadStatistics.clock>500</hudson.model.LoadStatistics.clock>
            <hudson.model.LoadStatistics.decay>0.5</hudson.model.LoadStatistics.decay>
            <hudson.agents.NodeProvisioner.MARGIN>100</hudson.agents.NodeProvisioner.MARGIN>
            <hudson.agents.NodeProvisioner.MARGIN0>1.0</hudson.agents.NodeProvisioner.MARGIN0>
            <hudson.remoting.Launcher.pingIntervalSec>-1</hudson.remoting.Launcher.pingIntervalSec>
            <com.google.jenkins.plugins.computeengine.integration.ITUtil.windows>${it.windows}</com.google.jenkins.plugins.computeengine.integration.ITUtil.windows>
          </systemPropertyVariables>
          <excludes>
            <exclude>**/ITUtil.java</exclude>
          </excludes>
          <argLine>-Djenkins.test.timeout=${jenkinsRuleTimeout}</argLine>
          <runOrder>${it.runOrder}</runOrder>
          <reuseForks>false</reuseForks>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <skipTests>${skip.surefire.tests}</skipTests>
          <runOrder>balanced</runOrder>
          <reuseForks>false</reuseForks>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>cobertura-maven-plugin</artifactId>
        <version>2.7</version>
        <configuration>
          <instrumentation>
            <excludes>
              <exclude>com/google/jenkins/plugins/**/Messages.class</exclude>
            </excludes>
          </instrumentation>
          <formats>
            <format>html</format>
            <format>xml</format>
          </formats>
        </configuration>
      </plugin>
      <plugin>
        <groupId>com.coveo</groupId>
        <artifactId>fmt-maven-plugin</artifactId>
        <version>2.8</version>
        <configuration>
          <sourceDirectory>src/main/java</sourceDirectory>
          <testSourceDirectory>src/test/java</testSourceDirectory>
          <verbose>true</verbose>
          <filesNamePattern>.*\.java</filesNamePattern>
          <skip>false</skip>
          <skipSortingImports>false</skipSortingImports>
          <style>google</style>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>format</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <version>3.2.1</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <shadedGroupFilter>com.google.cloud.graphite</shadedGroupFilter>
              <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
              <createDependencyReducedPom>false</createDependencyReducedPom>
              <transformers>
                <transformer implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer"/>
              </transformers>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>windows</id>
      <activation>
        <os>
          <family>Windows</family>
        </os>
      </activation>
      <properties>
        <concurrency>4</concurrency>
      </properties>
    </profile>
    <profile>
      <id>windows-agents</id>
      <activation>
        <property>
          <name>it.windows</name>
          <value>true</value>
        </property>
      </activation>
      <properties>
        <concurrency>4</concurrency>
        <it.runOrder>alphabetical</it.runOrder>
      </properties>
    </profile>
    <profile>
      <id>ci-cd</id>
      <activation>
        <property>
          <name>it.cicd</name>
          <value>true</value>
        </property>
      </activation>
      <properties>
        <concurrency>6</concurrency>
      </properties>
    </profile>
  </profiles>
</project>
