<?xml version="1.0" encoding="UTF-8"?>
<!--
 Copyright 2013 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.55</version>
  </parent>

  <!--
      Lots of boilerplate from: https://wiki.jenkins-ci.org/display/JENKINS/Hosting+Plugins
  -->
  <artifactId>google-oauth-plugin</artifactId>
  <version>1.0.2</version>
  <packaging>hpi</packaging>

  <name>Google OAuth Credentials plugin</name>
  <description>This plugin implements the OAuth Credentials interfaces to surface Google Service Account credentials to Jenkins.</description>
  <url>https://github.com/jenkinsci/google-oauth-plugin/blob/develop/docs/home.md</url>
  <licenses>
    <license>
      <name>The Apache V2 License</name>
      <url>https://www.apache.org/licenses/LICENSE-2.0</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <developers>
    <developer>
      <id>astroilov</id>
      <name>Andrey Stroilov</name>
    </developer>
    <developer>
      <id>craigdbarber</id>
      <name>Craig Barber</name>
      <email>craigbarber@google.com</email>
    </developer>
    <developer>
      <id>stephenashank</id>
      <name>Stephen Shank</name>
      <email>stephenshank@google.com</email>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:git://github.com/jenkinsci/${project.artifactId}.git</connection>
    <developerConnection>scm:git:git@github.com:jenkinsci/${project.artifactId}.git</developerConnection>
    <url>http://github.com/jenkinsci/${project.artifactId}</url>
    <tag>google-oauth-plugin-1.0.2</tag>
  </scm>

  <!-- Bring some sanity to version numbering... -->
  <properties>
    <jenkins.version>2.138.4</jenkins.version>
    <hpi.compatibleSinceVersion>1.0.0</hpi.compatibleSinceVersion>
    <!-- TODO: Update google versions when Jenkins core does not bundle guava 11. -->
    <google.api.version>1.25.0</google.api.version>
    <google.guava.version>24.1.1-jre</google.guava.version>
    <oauth2.revision>151</oauth2.revision>
    <google.http.version>1.21.0</google.http.version>
    <lombok.version>1.18.8</lombok.version>
    <java.level>8</java.level>
    <findbugs.excludeFilterFile>findbugs-exclude.xml</findbugs.excludeFilterFile>
    <findbugs.effort>Max</findbugs.effort>
    <findbugs.threshold>Medium</findbugs.threshold>
    <doclint>none</doclint>
    <runSuite>**/GoogleOAuthPluginTestSuite.class</runSuite>
    <configuration-as-code.version>1.35</configuration-as-code.version>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>io.jenkins.tools.bom</groupId>
        <artifactId>bom-2.138.x</artifactId>
        <version>3</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>jackson2-api</artifactId>
      <version>2.10.2</version>
    </dependency>
    <!-- com.google.guava -->
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>${google.guava.version}</version>
    </dependency>
    <!-- Apache Commons IO dependency -->
    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <version>2.7</version>
    </dependency>
    <!-- org.joda.time -->
    <dependency>
      <groupId>joda-time</groupId>
      <artifactId>joda-time</artifactId>
      <!-- XStream has deserialization warnings for Jodatime 2.0 or later -->
      <version>2.9.5</version>
    </dependency>
    <!-- Test dependencies -->
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-library</artifactId>
      <version>2.2</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <version>1.10.19</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.jenkins</groupId>
      <artifactId>configuration-as-code</artifactId>
      <version>${configuration-as-code.version}</version>
      <scope>test</scope>
      <!--Marked as optional so hpi:run does not include it. -->
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>io.jenkins.configuration-as-code</groupId>
      <artifactId>test-harness</artifactId>
      <version>${configuration-as-code.version}</version>
      <scope>test</scope>
      <optional>true</optional>
    </dependency>
    <!-- OAuth Credentials dependency -->
    <dependency>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>oauth-credentials</artifactId>
      <version>0.4</version>
    </dependency>
    <!-- com.google.http-client -->
    <dependency>
      <groupId>com.google.http-client</groupId>
      <artifactId>google-http-client</artifactId>
      <version>${google.http.version}</version>
      <exclusions>
        <exclusion>
          <groupId>org.apache.httpcomponents</groupId>
          <artifactId>httpclient</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>com.google.http-client</groupId>
      <artifactId>google-http-client-jackson2</artifactId>
      <version>${google.api.version}</version>
      <exclusions>
        <exclusion>
          <groupId>com.google.http-client</groupId>
          <artifactId>google-http-client</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <!-- com.google.api-client -->
    <dependency>
      <groupId>com.google.api-client</groupId>
      <artifactId>google-api-client</artifactId>
      <version>${google.api.version}</version>
      <exclusions>
        <exclusion>
          <groupId>com.google.http-client</groupId>
          <artifactId>google-http-client</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <!-- com.google.apis -->
    <!-- https://code.google.com/p/google-api-java-client/wiki/APIs -->
    <dependency>
      <groupId>com.google.apis</groupId>
      <artifactId>google-api-services-oauth2</artifactId>
      <version>v2-rev${oauth2.revision}-${google.api.version}</version>
      <exclusions>
        <exclusion>
          <groupId>com.google.http-client</groupId>
          <artifactId>google-http-client</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <!-- plugin dependencies -->
    <dependency>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>credentials</artifactId>
    </dependency>
    <dependency><!-- Required to run P12ServiceAccountConfigTestUtil-dependent tests against newer Jenkins core versions.
           Dependency on it does not cause issues in the baseline core even though the plugin is formally incompatible.
           Should it break at some point, the core requirement can be bumped to 2.17.x.
           The BC library can be also shaded if the core requirement needs to be retained.
       -->
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>bouncycastle-api</artifactId>
      <version>2.16.2</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.projectlombok</groupId>
      <artifactId>lombok</artifactId>
      <version>${lombok.version}</version>
    </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>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>2.9</version>
        <configuration>
          <includeTestSourceDirectory>true</includeTestSourceDirectory>
          <configLocation>checkstyle.xml</configLocation>
          <headerLocation>checkstyleJavaHeader</headerLocation>
          <failsOnError>true</failsOnError>
          <failOnViolation>true</failOnViolation>
          <violationSeverity>warning</violationSeverity>
          <consoleOutput>false</consoleOutput>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <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>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.codehaus.mojo</groupId>
        <artifactId>cobertura-maven-plugin</artifactId>
        <version>2.5.2</version>
        <configuration>
          <instrumentation>
            <excludes>
              <exclude>com/google/jenkins/plugins/**/Messages.class</exclude>
            </excludes>
          </instrumentation>
          <check/>
          <formats>
            <format>html</format>
            <format>xml</format>
          </formats>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <includes>
            <include>${runSuite}</include>
          </includes>
          <reuseForks>false</reuseForks>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>3.1.1</version>
        <configuration>
          <show>public</show>
          <source>8</source>
        </configuration>
      </plugin>
    </plugins>
  </reporting>
</project>
