<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>
  <groupId>org.kohsuke</groupId>
  <artifactId>github-api</artifactId>
  <version>1.123-SNAPSHOT</version>
  <name>GitHub API for Java</name>
  <url>https://github-api.kohsuke.org/</url>
  <description>GitHub API for Java</description>

  <scm>
    <connection>scm:git:git@github.com/hub4j/${project.artifactId}.git</connection>
    <developerConnection>scm:git:ssh://git@github.com/hub4j/${project.artifactId}.git</developerConnection>
    <url>https://github.com/hub4j/github-api/</url>
    <tag>HEAD</tag>
  </scm>

  <distributionManagement>
    <snapshotRepository>
      <id>sonatype-nexus-snapshots</id>
      <name>Sonatype Nexus Snapshots</name>
      <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
    </snapshotRepository>
    <repository>
      <id>sonatype-nexus-staging</id>
      <name>Nexus Release Repository</name>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
    <site>
      <id>github-pages</id>
      <url>gitsite:git@github.com/hub4j/${project.artifactId}.git</url>
    </site>
  </distributionManagement>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <spotbugs-maven-plugin.version>4.2.0</spotbugs-maven-plugin.version>
    <spotbugs.version>4.1.3</spotbugs.version>
    <spotbugs-maven-plugin.failOnError>true</spotbugs-maven-plugin.failOnError>
    <hamcrest.version>2.2</hamcrest.version>
    <okhttp3.version>4.4.1</okhttp3.version>
    <okio.version>2.5.0</okio.version>
    <spotless-maven-plugin.goal>apply</spotless-maven-plugin.goal>
    <!-- Using this as the minimum bar for code coverage.  Adding methods without covering them will fail this. -->
    <jacoco.coverage.target.bundle.method>0.70</jacoco.coverage.target.bundle.method>
    <jacoco.coverage.target.class.method>0.50</jacoco.coverage.target.class.method>
    <!-- For non-ci builds we'd like the build to still complete if jacoco metrics aren't met. -->
    <jacoco.haltOnFailure>false</jacoco.haltOnFailure>
    <jjwt.suite.version>0.11.2</jjwt.suite.version>
  </properties>

  <build>
    <extensions>
      <extension>
        <groupId>org.apache.maven.scm</groupId>
        <artifactId>maven-scm-provider-gitexe</artifactId>
        <version>1.11.2</version>
      </extension>
      <extension>
        <groupId>org.apache.maven.scm</groupId>
        <artifactId>maven-scm-manager-plexus</artifactId>
        <version>1.11.2</version>
      </extension>
      <!-- Doing site publishing manually for now -->
<!--
      <extension>
        <groupId>org.kohsuke</groupId>
        <artifactId>wagon-gitsite</artifactId>
        <version>0.3.5</version>
      </extension>
-->
    </extensions>
    <testResources>
      <testResource>
        <directory>src/test/resources</directory>
        <excludes>
          <exclude>**/wiremock/**</exclude>
        </excludes>
      </testResource>
    </testResources>
    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.22.2</version>
          <configuration>
            <!-- SUREFIRE-1226 workaround -->
            <trimStackTrace>false</trimStackTrace>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>3.2.1</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-gpg-plugin</artifactId>
          <version>1.6</version>
        </plugin>
        <plugin>
          <groupId>org.jacoco</groupId>
          <artifactId>jacoco-maven-plugin</artifactId>
          <version>0.8.6</version>
          <executions>
            <execution>
              <goals>
                <goal>prepare-agent</goal>
              </goals>
            </execution>
            <!-- attached to Maven test phase -->
            <execution>
              <id>report</id>
              <phase>test</phase>
              <goals>
                <goal>report</goal>
              </goals>
            </execution>
            <execution>
              <id>check</id>
              <phase>test</phase>
              <goals>
                <goal>check</goal>
              </goals>
              <configuration>
                <rules>
                  <rule>
                    <element>BUNDLE</element>
                    <limits>
                      <limit>
                        <counter>METHOD</counter>
                        <value>COVEREDRATIO</value>
                        <minimum>${jacoco.coverage.target.bundle.method}</minimum>
                      </limit>
                    </limits>
                  </rule>
                  <rule>
                    <!--We end up with chatty logs, but it shows us which particular classes    -->
                    <!--are lacking in coverage. If this is too much, just remove the           -->
                    <!--<element>CLASS</element> tag below.                                     -->
                    <element>CLASS</element>
                    <limits>
                      <limit>
                        <counter>METHOD</counter>
                        <value>COVEREDRATIO</value>
                        <minimum>${jacoco.coverage.target.class.method}</minimum>
                      </limit>
                    </limits>
                    <excludes>
                      <!-- Code implemented externally -->
                      <exclude>org.kohsuke.github.extras.okhttp3.ObsoleteUrlFactory.**</exclude>
                      <exclude>org.kohsuke.github.extras.okhttp3.ObsoleteUrlFactory</exclude>

                      <!-- Sample only -->
                      <exclude>org.kohsuke.github.example.*</exclude>


                      <!-- Deprecated -->
                      <exclude>org.kohsuke.github.extras.OkHttp3Connector</exclude>
                      <exclude>org.kohsuke.github.EnforcementLevel</exclude>
                      <exclude>org.kohsuke.github.GHPerson.1</exclude>
                      <!-- TODO: Some coverage, but more needed -->
                      <exclude>org.kohsuke.github.GHPullRequestReviewBuilder.DraftReviewComment</exclude>
                      <exclude>org.kohsuke.github.GHIssue.PullRequest</exclude>
                      <exclude>org.kohsuke.github.GHCommitSearchBuilder</exclude>
                      <exclude>org.kohsuke.github.GHRepositorySearchBuilder</exclude>
                      <exclude>org.kohsuke.github.GHUserSearchBuilder</exclude>

                      <!-- TODO: These still need test coverage -->
                      <exclude>org.kohsuke.github.GHBranchProtection.RequiredSignatures</exclude>
                      <exclude>org.kohsuke.github.GHBranchProtectionBuilder.Restrictions</exclude>
                      <exclude>org.kohsuke.github.GHBranchProtection.Restrictions</exclude>
                      <exclude>org.kohsuke.github.GHCommentAuthorAssociation</exclude>
                      <exclude>org.kohsuke.github.GHCompare.Commit</exclude>
                      <exclude>org.kohsuke.github.GHCompare.InnerCommit</exclude>
                      <exclude>org.kohsuke.github.GHCompare.Tree</exclude>
                      <exclude>org.kohsuke.github.GHCompare.User</exclude>
                      <exclude>org.kohsuke.github.GHCompare</exclude>
                      <exclude>org.kohsuke.github.GHDeployKey</exclude>
                      <exclude>org.kohsuke.github.GHEmail</exclude>
                      <exclude>org.kohsuke.github.GHInvitation</exclude>
                      <exclude>org.kohsuke.github.GHPullRequestCommitDetail.Authorship</exclude>
                      <exclude>org.kohsuke.github.GHPullRequestCommitDetail.Commit</exclude>
                      <exclude>org.kohsuke.github.GHPullRequestCommitDetail.CommitPointer</exclude>
                      <exclude>org.kohsuke.github.GHPullRequestCommitDetail.Tree</exclude>
                      <exclude>org.kohsuke.github.GHPullRequestCommitDetail</exclude>
                      <exclude>org.kohsuke.github.GHPullRequestFileDetail</exclude>
                      <exclude>org.kohsuke.github.GHReleaseUpdater</exclude>
                      <exclude>org.kohsuke.github.GHRequestedAction</exclude>
                      <exclude>org.kohsuke.github.GHVerifiedKey</exclude>
                    </excludes>
                  </rule>
                </rules>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>3.2.0</version>
          <configuration>
            <source>8</source>
            <failOnWarnings>true</failOnWarnings>
            <doclint>all</doclint>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.sonatype.plugins</groupId>
          <artifactId>nexus-staging-maven-plugin</artifactId>
          <version>1.6.8</version>
          <extensions>true</extensions>
          <configuration>
            <serverId>sonatype-nexus-staging</serverId>
            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
            <autoReleaseAfterClose>true</autoReleaseAfterClose>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
        <version>3.9.1</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <version>2.5.3</version>
        <configuration>
          <autoVersionSubmodules>true</autoVersionSubmodules>
          <useReleaseProfile>false</useReleaseProfile>
          <releaseProfiles>release</releaseProfiles>
          <goals>deploy</goals>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.sonatype.plugins</groupId>
        <artifactId>nexus-staging-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <version>3.1.1</version>
        <dependencies>
          <dependency>
            <groupId>org.apache.bcel</groupId>
            <artifactId>bcel</artifactId>
            <version>6.5.0</version>
          </dependency>
        </dependencies>
      </plugin>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.8.1</version>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
          <annotationProcessorPaths>
            <annotationProcessorPath>
              <groupId>org.jenkins-ci</groupId>
              <artifactId>annotation-indexer</artifactId>
              <version>1.12</version>
            </annotationProcessorPath>
          </annotationProcessorPaths>
        </configuration>
      </plugin>

      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <executions>
          <execution>
            <id>default-test</id>
            <configuration>
              <excludesFile>src/test/resources/slow-or-flaky-tests.txt</excludesFile>
            </configuration>
          </execution>
          <execution>
            <id>slow-or-flaky-test</id>
            <phase>test</phase>
            <goals>
              <goal>test</goal>
            </goals>
            <configuration>
              <rerunFailingTestsCount>2</rerunFailingTestsCount>
              <!-- There are some tests that take longer or are a little flaky.  Run them here. -->
              <includesFile>src/test/resources/slow-or-flaky-tests.txt</includesFile>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>animal-sniffer-maven-plugin</artifactId>
        <version>1.19</version>
        <configuration>
          <signature>
            <groupId>org.codehaus.mojo.signature</groupId>
            <artifactId>java18</artifactId>
            <version>1.0</version>
          </signature>
        </configuration>
        <executions>
          <execution>
            <id>ensure-java-1.8-class-library</id>
            <phase>test</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>com.infradna.tool</groupId>
        <artifactId>bridge-method-injector</artifactId>
        <version>1.18</version>
        <executions>
          <execution>
            <goals>
              <goal>process</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>com.diffplug.spotless</groupId>
        <artifactId>spotless-maven-plugin</artifactId>
        <version>2.7.0</version>
        <executions>
          <execution>
            <id>spotless-check</id>
            <phase>process-sources</phase>
            <goals>
              <goal>${spotless-maven-plugin.goal}</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <java>
            <eclipse>
              <file>${basedir}/src/build/eclipse/formatter.xml</file>
            </eclipse>

            <importOrder>
              <file>${basedir}/src/build/eclipse/eclipse.importorder</file>
            </importOrder>
            <removeUnusedImports />

            <trimTrailingWhitespace />
            <endWithNewline />

          </java>
        </configuration>
      </plugin>
      <plugin>
        <groupId>com.github.spotbugs</groupId>
        <artifactId>spotbugs-maven-plugin</artifactId>
        <version>${spotbugs-maven-plugin.version}</version>
        <configuration>
          <xmlOutput>true</xmlOutput>
          <failOnError>${spotbugs-maven-plugin.failOnError}</failOnError>
        </configuration>
        <executions>
          <execution>
            <id>run-spotbugs</id>
            <phase>verify</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
        <dependencies>
          <!-- overwrite dependency on spotbugs if you want to specify the version of spotbugs -->
          <dependency>
            <groupId>com.github.spotbugs</groupId>
            <artifactId>spotbugs</artifactId>
            <version>${spotbugs.version}</version>
          </dependency>
        </dependencies>
      </plugin>
    </plugins>
  </build>

  <dependencies>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
      <version>3.9</version>
    </dependency>
    <dependency>
      <groupId>com.tngtech.archunit</groupId>
      <artifactId>archunit</artifactId>
      <version>0.16.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest</artifactId>
      <version>${hamcrest.version}</version>
      <scope>test</scope>
    </dependency>
    <!-- This is needed in order to force junit4 and JTH tests to use newer hamcrest version -->
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-core</artifactId>
      <version>${hamcrest.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-library</artifactId>
      <version>${hamcrest.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.13.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
      <version>2.10.2</version>
    </dependency>
    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <version>2.4</version>
    </dependency>
    <dependency>
      <groupId>com.infradna.tool</groupId>
      <artifactId>bridge-method-annotation</artifactId>
      <version>1.18</version>
      <optional>true</optional>
    </dependency>
    <!-- for stapler-jetty -->
    <dependency>
      <groupId>commons-fileupload</groupId>
      <artifactId>commons-fileupload</artifactId>
      <version>1.4</version>
      <scope>test</scope>
    </dependency>
    <!-- for stapler-jetty -->
    <dependency>
      <groupId>commons-discovery</groupId>
      <artifactId>commons-discovery</artifactId>
      <version>0.5</version>
      <scope>test</scope>
    </dependency>
    <!-- for stapler-jetty -->
    <dependency>
      <groupId>org.kohsuke.stapler</groupId>
      <artifactId>stapler</artifactId>
      <version>1.262</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.kohsuke.stapler</groupId>
      <artifactId>stapler-jetty</artifactId>
      <version>1.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jgit</groupId>
      <artifactId>org.eclipse.jgit</artifactId>
      <version>5.10.0.202012080955-r</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.jsonwebtoken</groupId>
      <artifactId>jjwt-api</artifactId>
      <version>${jjwt.suite.version}</version>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>io.jsonwebtoken</groupId>
      <artifactId>jjwt-impl</artifactId>
      <version>${jjwt.suite.version}</version>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>io.jsonwebtoken</groupId>
      <artifactId>jjwt-jackson</artifactId>
      <version>${jjwt.suite.version}</version>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>com.squareup.okio</groupId>
      <artifactId>okio</artifactId>
      <version>${okio.version}</version>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>com.squareup.okhttp3</groupId>
      <artifactId>okhttp</artifactId>
      <version>${okhttp3.version}</version>
      <optional>true</optional>
    </dependency>
    <!-- This is the last version of okhttp3 that support UrlConnection -->
    <!-- The class using this has been deprecated, this dependency can be remove when that class is. -->
    <dependency>
      <groupId>com.squareup.okhttp3</groupId>
      <artifactId>okhttp-urlconnection</artifactId>
      <version>3.12.3</version>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>com.squareup.okhttp</groupId>
      <artifactId>okhttp-urlconnection</artifactId>
      <version>2.7.5</version>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>org.kohsuke</groupId>
      <artifactId>wordnet-random-name</artifactId>
      <version>1.3</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <version>3.7.7</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.github.spotbugs</groupId>
      <artifactId>spotbugs-annotations</artifactId>
      <version>${spotbugs.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.github.tomakehurst</groupId>
      <artifactId>wiremock-jre8-standalone</artifactId>
      <version>2.27.2</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.google.code.gson</groupId>
      <artifactId>gson</artifactId>
      <version>2.8.6</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-simple</artifactId>
      <version>1.7.30</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>
  <profiles>
    <profile>
      <id>ci-non-windows</id>
      <activation>
        <property>
          <name>enable-ci</name>
        </property>
        <os>
          <family>!windows</family>
        </os>
      </activation>
      <properties>
        <!-- Only fail code coverage on non-windows machines -->
        <jacoco.haltOnFailure>true</jacoco.haltOnFailure>
        <spotless-maven-plugin.goal>check</spotless-maven-plugin.goal>
      </properties>
    </profile>
    <profile>
      <id>ci-all</id>
      <activation>
        <property>
          <name>enable-ci</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>release</id>
      <properties>
        <spotless-maven-plugin.goal>check</spotless-maven-plugin.goal>
      </properties>
      <build>
        <plugins>
          <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
                <configuration>
                  <gpgArguments>
                    <arg>--pinentry-mode</arg>
                    <arg>loopback</arg>
                  </gpgArguments>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
  <reporting>
    <plugins>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <reportSets>
          <reportSet>
            <reports>
              <!-- select non-aggregate reports -->
              <report>report</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-project-info-reports-plugin</artifactId>
      </plugin>
    </plugins>
  </reporting>

  <licenses>
    <license>
      <name>The MIT license</name>
      <url>https://www.opensource.org/licenses/mit-license.php</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <mailingLists>
    <mailingList>
      <name>User List</name>
      <post>github-api@googlegroups.com</post>
      <archive>https://groups.google.com/forum/#!forum/github-api</archive>
    </mailingList>
  </mailingLists>

  <developers>
    <developer>
      <name>Kohsuke Kawaguchi</name>
      <id>kohsuke</id>
      <email>kk@kohsuke.org</email>
    </developer>
  </developers>

</project>
