<?xml version="1.0" encoding="UTF-8"?>
<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>
    <!-- See https://github.com/jenkinsci/plugin-pom/blob/master/CHANGELOG.md -->
    <version>3.54</version>
    <relativePath />
  </parent>

  <artifactId>sonar</artifactId>
  <version>2.13.1</version>
  <packaging>hpi</packaging>

  <name>SonarQube Scanner for Jenkins</name>
  <url>https://github.com/jenkinsci/sonarqube-plugin</url>
  <inceptionYear>2007</inceptionYear>
  <organization>
    <name>SonarSource</name>
    <url>https://sonarsource.com</url>
  </organization>
  <licenses>
    <license>
      <name>GNU Lesser General Public License (LGPL), v.3</name>
      <url>https://www.gnu.org/licenses/lgpl.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <scm>
    <connection>scm:git:git://github.com/jenkinsci/sonarqube-plugin.git</connection>
    <developerConnection>scm:git:git@github.com:jenkinsci/sonarqube-plugin.git</developerConnection>
    <url>https://github.com/jenkinsci/sonarqube-plugin</url>
    <tag>sonar-2.13.1</tag>
  </scm>
  <issueManagement>
    <system>JIRA</system>
    <url>https://jira.sonarsource.com/browse/SONARJNKNS</url>
  </issueManagement>
  <ciManagement>
    <system>Travis</system>
    <url>https://travis-ci.org/SonarSource/sonar-scanner-jenkins</url>
  </ciManagement>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <hudson.version>${project.parent.version}</hudson.version>
    <sonar.exclusions>target/generated-sources/**/*</sonar.exclusions>
    <gitRepositoryName>sonar-scanner-jenkins</gitRepositoryName>
    <version.artifactory.plugin>2.6.1</version.artifactory.plugin>
    <jenkins.version>2.150.3</jenkins.version>
    <java.level>8</java.level>
    <findbugs.failOnError>false</findbugs.failOnError>
    <!-- Disable parallel tests on Travis -->
    <concurrency>1</concurrency>
    <!-- Skip Spotbugs, we are using SonarQube -->
    <spotbugs.skip>true</spotbugs.skip>
    <!-- No need to rerun tests, because of HAP-859, artifactory plugin will not upload the artifact -->
    <surefire.rerunFailingTestsCount>0</surefire.rerunFailingTestsCount>

    <!-- To configure maven-license-plugin to check license headers -->
    <license.name>GNU LGPL v3</license.name>
    <license.owner>SonarSource SA</license.owner>
    <license.title>${project.name}</license.title>
    <license.years>${project.inceptionYear}-2021</license.years>
    <license.mailto>mailto:info AT sonarsource DOT com</license.mailto>

    <artifactsToPublish>${project.groupId}:${project.artifactId}:hpi</artifactsToPublish>
  </properties>

  <dependencyManagement>
    <dependencies>
      <!-- Resolve dependency conflicts of plugins used during tests (workflow) -->
      <dependency>
        <groupId>commons-io</groupId>
        <artifactId>commons-io</artifactId>
        <version>2.6</version>
      </dependency>
      <dependency>
        <groupId>org.apache.ant</groupId>
        <artifactId>ant</artifactId>
        <version>1.10.9</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-embedder</artifactId>
        <version>3.5.0</version>
      </dependency>
      <dependency>
        <groupId>org.codehaus.plexus</groupId>
        <artifactId>plexus-classworlds</artifactId>
        <version>2.5.2</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-core</artifactId>
        <version>3.5.0</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-aether-provider</artifactId>
        <version>3.3.1</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-compat</artifactId>
        <version>3.5.0</version>
      </dependency>
      <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpclient</artifactId>
        <version>4.5.2</version>
      </dependency>
      <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpcore</artifactId>
        <version>4.4.4</version>
      </dependency>
      <dependency>
        <groupId>org.jenkins-ci.plugins.workflow</groupId>
        <artifactId>workflow-step-api</artifactId>
        <version>2.14</version>
      </dependency>
      <dependency>
        <groupId>org.jenkins-ci.plugins</groupId>
        <artifactId>ssh-credentials</artifactId>
        <version>1.13</version>
      </dependency>
      <dependency>
        <groupId>commons-net</groupId>
        <artifactId>commons-net</artifactId>
        <version>3.6</version>
      </dependency>
    </dependencies>
  </dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
      <version>3.7</version>
    </dependency>
    <dependency>
      <groupId>org.sonarsource.sonarqube</groupId>
      <artifactId>sonar-ws</artifactId>
      <version>6.7</version>
    </dependency>
    <dependency>
      <!-- needed for SonarPublisher -->
      <groupId>org.jenkins-ci.main</groupId>
      <artifactId>maven-plugin</artifactId>
      <version>2.17</version>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>configurationslicing</artifactId>
      <version>1.47</version>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.plugins.workflow</groupId>
      <artifactId>workflow-support</artifactId>
      <version>3.0</version>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>credentials</artifactId>
      <version>2.1.13</version>
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>plain-credentials</artifactId>
      <version>1.4</version>
    </dependency>
    <!-- Webhook secret validation -->
    <dependency>
      <groupId>commons-codec</groupId>
      <artifactId>commons-codec</artifactId>
      <version>1.13</version>
    </dependency>

    <!-- Test deps -->
    <dependency>
      <groupId>com.tngtech.java</groupId>
      <artifactId>junit-dataprovider</artifactId>
      <version>1.13.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <groupId>org.hamcrest</groupId>
          <artifactId>hamcrest-core</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <version>3.11.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.plugins.workflow</groupId>
      <artifactId>workflow-cps</artifactId>
      <version>2.45</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.plugins.workflow</groupId>
      <artifactId>workflow-job</artifactId>
      <version>2.17</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.plugins.workflow</groupId>
      <artifactId>workflow-durable-task-step</artifactId>
      <version>2.19</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.plugins.workflow</groupId>
      <artifactId>workflow-basic-steps</artifactId>
      <version>2.6</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>structs</artifactId>
      <version>1.14</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>mailer</artifactId>
      <version>1.18</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jenkinsci.plugins</groupId>
      <artifactId>pipeline-model-definition</artifactId>
      <version>1.2.7</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.jenkins</groupId>
      <artifactId>configuration-as-code</artifactId>
      <version>1.32</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.jenkins</groupId>
      <artifactId>configuration-as-code</artifactId>
      <version>1.32</version>
      <classifier>tests</classifier>
      <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>
    <pluginManagement>
      <plugins>
        <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.4</version>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <configuration>
          <localCheckout>true</localCheckout>
          <pushChanges>true</pushChanges>
        </configuration>
      </plugin>
      <plugin>
        <groupId>com.mycila</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <version>3.0</version>
        <dependencies>
          <dependency>
            <groupId>org.sonarsource.license-headers</groupId>
            <artifactId>license-headers</artifactId>
            <version>1.3</version>
          </dependency>
        </dependencies>
        <configuration>
          <header>sonarsource/licenseheaders/${license.name}.txt</header>
          <failIfMissing>true</failIfMissing>
          <strictCheck>true</strictCheck>
          <encoding>${project.build.sourceEncoding}</encoding>
          <properties>
            <license.owner>${license.owner}</license.owner>
            <license.title>${license.title}</license.title>
            <license.years>${license.years}</license.years>
            <license.mailto>${license.mailto}</license.mailto>
          </properties>
          <mapping>
            <java>SLASHSTAR_STYLE</java>
            <js>SLASHSTAR_STYLE</js>
            <css>SLASHSTAR_STYLE</css>
            <less>SLASHSTAR_STYLE</less>
          </mapping>
          <includes>
            <include>src/*/java/**/*.java</include>
            <include>src/*/js/**/*.js</include>
            <include>src/*/css/**/*.css</include>
            <include>src/*/less/**/*.less</include>
          </includes>
        </configuration>
        <executions>
          <execution>
            <id>enforce-license-headers</id>
            <phase>validate</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <configuration>
          <source>8</source>
          <doclint>none</doclint>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>coverage</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <version>0.8.4</version>
            <executions>
              <execution>
                <id>prepare-agent</id>
                <goals>
                  <goal>prepare-agent</goal>
                </goals>
              </execution>
              <execution>
                <id>report</id>
                <goals>
                  <goal>report</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>deploy-sonarsource</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-enforcer-plugin</artifactId>
            <executions>
              <execution>
                <id>enforce-deploy-settings</id>
                <goals>
                  <goal>enforce</goal>
                </goals>
                <configuration>
                  <rules>
                    <requireProperty>
                      <property>gitRepositoryName</property>
                      <message>You must set name of Git repository in your pom</message>
                    </requireProperty>
                    <requireEnvironmentVariable>
                      <variableName>ARTIFACTORY_URL</variableName>
                    </requireEnvironmentVariable>
                    <requireEnvironmentVariable>
                      <variableName>ARTIFACTORY_DEPLOY_REPO</variableName>
                    </requireEnvironmentVariable>
                    <requireEnvironmentVariable>
                      <variableName>ARTIFACTORY_DEPLOY_USERNAME</variableName>
                    </requireEnvironmentVariable>
                    <requireEnvironmentVariable>
                      <variableName>ARTIFACTORY_DEPLOY_PASSWORD</variableName>
                    </requireEnvironmentVariable>
                  </rules>
                  <fail>true</fail>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <!-- this maven plugin is not deployed in Maven Central. It should be downloaded from JFrog JCenter or from SonarSource
              repositories -->
            <groupId>org.jfrog.buildinfo</groupId>
            <artifactId>artifactory-maven-plugin</artifactId>
            <version>${version.artifactory.plugin}</version>
            <executions>
              <execution>
                <id>build-info</id>
                <goals>
                  <goal>publish</goal>
                </goals>
                <configuration>
                  <artifactory>
                    <envVarsExcludePatterns>
                      *password*,*PASSWORD*,*secret*,*MAVEN_CMD_LINE_ARGS*,sun.java.command,*token*,*TOKEN*,*LOGIN*,*login*,*SIGN_KEY*,*ARTIFACTORY_API_KEY*,*API_KEY*,*PASSPHRASE*
                    </envVarsExcludePatterns>
                    <includeEnvVars>true</includeEnvVars>
                    <timeoutSec>60</timeoutSec>
                  </artifactory>
                  <deployProperties>
                    <vcs.revision>{{GIT_COMMIT|TRAVIS_COMMIT}}</vcs.revision>
                    <vcs.branch>{{GIT_BRANCH|TRAVIS_BRANCH}}</vcs.branch>
                    <build.name>${gitRepositoryName}</build.name>
                    <build.number>{{BUILD_ID|TRAVIS_BUILD_NUMBER}}</build.number>
                  </deployProperties>
                  <licenses>
                    <autoDiscover>true</autoDiscover>
                    <includePublishedArtifacts>false</includePublishedArtifacts>
                    <runChecks>true</runChecks>
                    <scopes>project,provided</scopes>
                    <violationRecipients>licences-control@sonarsource.com</violationRecipients>
                  </licenses>
                  <publisher>
                    <contextUrl>${env.ARTIFACTORY_URL}</contextUrl>
                    <repoKey>${env.ARTIFACTORY_DEPLOY_REPO}</repoKey>
                    <username>${env.ARTIFACTORY_DEPLOY_USERNAME}</username>
                    <password>${env.ARTIFACTORY_DEPLOY_PASSWORD}</password>
                    <publishBuildInfo>true</publishBuildInfo>
                    <publishArtifacts>true</publishArtifacts>
                  </publisher>
                  <buildInfo>
                    <buildName>${gitRepositoryName}</buildName>
                    <buildNumber>{{BUILD_ID|TRAVIS_BUILD_NUMBER}}</buildNumber>
                    <buildUrl>{{CI_BUILD_URL|BUILD_URL}}</buildUrl>
                    <vcsRevision>{{GIT_COMMIT|TRAVIS_COMMIT}}</vcsRevision>
                  </buildInfo>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
