<?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>
    <version>5.7</version>
    <relativePath />
  </parent>

  <groupId>org.jvnet.hudson.plugins</groupId>
  <artifactId>analysis-pom</artifactId>
  <version>10.4.0</version>
  <packaging>pom</packaging>
  <name>Analysis Plug-ins Parent POM</name>
  <description>This static analysis POM serves as parent POM for all my Jenkins Plugins. It basically enhances the
    Parent POM for Jenkins Plugins (see https://github.com/jenkinsci/plugin-pom) with a predefined configuration of
    several static analysis tools. Additionally, it provides a fix set of test dependencies that are common
    to all my plugins. This POM enforces the Java style guide (see https://github.com/uhafner/codingstyle) that I am
    using in these plugins (and in my lectures at the Munich University of Applied Sciences).</description>

  <url>https://github.com/jenkinsci/analysis-pom-plugin</url>

  <licenses>
    <license>
      <name>MIT license</name>
      <comments>All source code is under the MIT license.</comments>
    </license>
  </licenses>

  <developers>
    <developer>
      <id>uhafner</id>
      <name>Ullrich Hafner</name>
      <email>ullrich.hafner@gmail.com</email>
      <url>https://cs.hm.edu/~hafner</url>
      <organization>Munich University of Applied Sciences</organization>
      <organizationUrl>https://www.hm.edu/en/index.en.html</organizationUrl>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:https://github.com/jenkinsci/${project.artifactId}-plugin.git</connection>
    <developerConnection>scm:git:git@github.com:jenkinsci/${project.artifactId}-plugin.git</developerConnection>
    <tag>v10.4.0</tag>
    <url>https://github.com/jenkinsci/${project.artifactId}-plugin</url>
  </scm>

  <properties>
    <jenkins.baseline>2.479</jenkins.baseline>
    <jenkins.version>${jenkins.baseline}.3</jenkins.version>
    <java.version>${maven.compiler.release}</java.version>
    <spotbugs.failOnError>false</spotbugs.failOnError>
    <codingstyle.config.version>5.7.0</codingstyle.config.version>

    <pmd.skip>false</pmd.skip>

    <!-- NPM and node versions for frontend-maven-plugin -->
    <node.version>22.13.1</node.version>
    <npm.version>10.9.2</npm.version>
    <nodeDownloadRoot>https://repo.jenkins-ci.org/nodejs-dist/</nodeDownloadRoot>
    <npmDownloadRoot>https://repo.jenkins-ci.org/npm-dist/</npmDownloadRoot>

    <!-- Test Library Dependencies Versions -->
    <equalsverifier.version>3.19</equalsverifier.version>
    <junit-pioneer.version>2.3.0</junit-pioneer.version>
    <assertj.version>3.27.3</assertj.version>
    <archunit.version>1.4.0</archunit.version>
    <json-unit-fluent.version>3.5.0</json-unit-fluent.version>

    <!-- Maven plug-in versions -->
    <spotbugs.version>4.9.1</spotbugs.version>
    <spotbugs-maven-plugin.version>4.8.6.6</spotbugs-maven-plugin.version>
    <pmd.version>7.7.0</pmd.version>
    <maven-checkstyle-plugin.version>3.6.0</maven-checkstyle-plugin.version>
    <checkstyle.version>10.21.2</checkstyle.version>
    <maven-pmd-plugin.version>3.26.0</maven-pmd-plugin.version>
    <findsecbugs-plugin.version>1.13.0</findsecbugs-plugin.version>
    <pitest-maven.version>1.18.1</pitest-maven.version>
    <pitest-junit5-plugin.version>1.2.1</pitest-junit5-plugin.version>
    <revapi-maven-plugin.version>0.15.0</revapi-maven-plugin.version>
    <revapi-java.version>0.28.1</revapi-java.version>
    <revapi-reporter-json-version>0.5.0</revapi-reporter-json-version>
    <assertj-assertions-generator-maven-plugin.version>2.2.0</assertj-assertions-generator-maven-plugin.version>
    <depgraph-maven-plugin.version>4.0.3</depgraph-maven-plugin.version>

    <!-- OpenRewrite versions   -->
    <rewrite-maven-plugin.version>6.1.3</rewrite-maven-plugin.version>
    <rewrite-testing-frameworks.version>3.2.0</rewrite-testing-frameworks.version>
    <rewrite-static-analysis.version>2.2.0</rewrite-static-analysis.version>
    <rewrite-migrate-java.version>3.2.0</rewrite-migrate-java.version>
    <rewrite-recommendations.version>1.15.0</rewrite-recommendations.version>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>io.jenkins.tools.bom</groupId>
        <artifactId>bom-${jenkins.baseline}.x</artifactId>
        <version>4136.vca_c3202a_7fd1</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <!-- Project Dependencies -->
    <dependency>
      <groupId>io.jenkins.plugins</groupId>
      <artifactId>commons-lang3-api</artifactId>
    </dependency>
    <dependency>
      <groupId>io.jenkins.plugins</groupId>
      <artifactId>commons-text-api</artifactId>
    </dependency>

    <!-- Test Dependencies -->
    <dependency>
      <groupId>nl.jqno.equalsverifier</groupId>
      <artifactId>equalsverifier</artifactId>
      <version>${equalsverifier.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit-pioneer</groupId>
      <artifactId>junit-pioneer</artifactId>
      <version>${junit-pioneer.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <version>${assertj.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.tngtech.archunit</groupId>
      <artifactId>archunit-junit5</artifactId>
      <version>${archunit.version}</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <groupId>org.slf4j</groupId>
          <artifactId>slf4j-api</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>net.javacrumbs.json-unit</groupId>
      <artifactId>json-unit-assertj</artifactId>
      <version>${json-unit-fluent.version}</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <groupId>org.ow2.asm</groupId>
          <artifactId>asm</artifactId>
        </exclusion>
      </exclusions>
    </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>com.github.ekryd.sortpom</groupId>
          <artifactId>sortpom-maven-plugin</artifactId>
          <version>${sortpom-maven-plugin.version}</version>
          <configuration>
            <expandEmptyElements>false</expandEmptyElements>
            <spaceBeforeCloseEmptyElement>true</spaceBeforeCloseEmptyElement>
            <createBackupFile>false</createBackupFile>
            <sortPlugins>groupId,artifactId</sortPlugins>
            <sortExecutions>true</sortExecutions>
          </configuration>
        </plugin>
        <plugin>
          <groupId>com.github.ferstl</groupId>
          <artifactId>depgraph-maven-plugin</artifactId>
          <version>${depgraph-maven-plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>io.github.git-commit-id</groupId>
          <artifactId>git-commit-id-maven-plugin</artifactId>
          <version>${git-commit-id-maven-plugin.version}</version>
          <configuration>
            <generateGitPropertiesFile>true</generateGitPropertiesFile>
            <generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>
            <includeOnlyProperties>
              <includeOnlyProperty>^git.build.(time|version)$</includeOnlyProperty>
              <includeOnlyProperty>^git.commit.id.(abbrev|full)$</includeOnlyProperty>
            </includeOnlyProperties>
            <commitIdGenerationMode>full</commitIdGenerationMode>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-checkstyle-plugin</artifactId>
          <version>${maven-checkstyle-plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-pmd-plugin</artifactId>
          <version>${maven-pmd-plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.assertj</groupId>
          <artifactId>assertj-assertions-generator-maven-plugin</artifactId>
          <version>${assertj-assertions-generator-maven-plugin.version}</version>
          <configuration>
            <excludes>
              <exclude>.*ITest</exclude>
              <exclude>.*Action</exclude>
            </excludes>
            <cleanTargetDir>true</cleanTargetDir>
            <hierarchical>false</hierarchical>
            <generateBddAssertions>false</generateBddAssertions>
            <generateJUnitSoftAssertions>false</generateJUnitSoftAssertions>
            <quiet>true</quiet>
            <templates>
              <templatesDirectory>${project.basedir}/etc/assertj-templates/</templatesDirectory>
              <assertionsEntryPointClass>assertions_entry_point_class_template.txt</assertionsEntryPointClass>
              <softEntryPointAssertionClass>soft_assertions_entry_point_class_template.txt</softEntryPointAssertionClass>
              <objectAssertion>has_assertion_template.txt</objectAssertion>
            </templates>
          </configuration>
          <executions>
            <execution>
              <goals>
                <goal>generate-assertions</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.openrewrite.maven</groupId>
          <artifactId>rewrite-maven-plugin</artifactId>
          <version>${rewrite-maven-plugin.version}</version>
          <configuration>
            <activeRecipes>
              <recipe>org.openrewrite.maven.BestPractices</recipe>
              <recipe>org.openrewrite.maven.RemoveRedundantDependencyVersions</recipe>
              <recipe>org.openrewrite.staticanalysis.AddSerialAnnotationToSerialVersionUID</recipe>
              <recipe>org.openrewrite.staticanalysis.MissingOverrideAnnotation</recipe>
              <recipe>org.openrewrite.staticanalysis.CodeCleanup</recipe>
              <recipe>org.openrewrite.staticanalysis.CommonStaticAnalysis</recipe>
              <recipe>org.openrewrite.staticanalysis.RemoveExtraSemicolons</recipe>
              <recipe>org.openrewrite.java.migrate.UpgradeToJava17</recipe>
              <recipe>org.openrewrite.java.migrate.util.SequencedCollection</recipe>
              <recipe>org.openrewrite.java.migrate.lang.var.UseVarForObject</recipe>
              <recipe>org.openrewrite.java.migrate.net.JavaNetAPIs</recipe>
              <recipe>org.openrewrite.java.migrate.util.JavaUtilAPIs</recipe>
              <recipe>org.openrewrite.java.migrate.lang.StringRulesRecipes</recipe>
              <recipe>org.openrewrite.java.format.RemoveTrailingWhitespace</recipe>
              <recipe>org.openrewrite.java.format.BlankLines</recipe>
              <recipe>org.openrewrite.java.format.EmptyNewlineAtEndOfFile</recipe>
              <recipe>org.openrewrite.java.testing.assertj.SimplifyChainedAssertJAssertions</recipe>
            </activeRecipes>
          </configuration>
          <dependencies>
            <dependency>
              <groupId>org.openrewrite.recipe</groupId>
              <artifactId>rewrite-testing-frameworks</artifactId>
              <version>${rewrite-testing-frameworks.version}</version>
            </dependency>
            <dependency>
              <groupId>org.openrewrite.recipe</groupId>
              <artifactId>rewrite-static-analysis</artifactId>
              <version>${rewrite-static-analysis.version}</version>
            </dependency>
            <dependency>
              <groupId>org.openrewrite.recipe</groupId>
              <artifactId>rewrite-migrate-java</artifactId>
              <version>${rewrite-migrate-java.version}</version>
            </dependency>
            <dependency>
              <groupId>org.openrewrite.recipe</groupId>
              <artifactId>rewrite-recommendations</artifactId>
              <version>${rewrite-recommendations.version}</version>
            </dependency>
          </dependencies>
        </plugin>
        <plugin>
          <groupId>org.owasp</groupId>
          <artifactId>dependency-check-maven</artifactId>
          <version>${dependency-check-maven.version}</version>
        </plugin>
        <plugin>
          <groupId>org.pitest</groupId>
          <artifactId>pitest-maven</artifactId>
          <version>${pitest-maven.version}</version>
          <configuration>
            <outputFormats>XML,HTML</outputFormats>
            <excludedTestClasses>
              <param>*ITest</param>
            </excludedTestClasses>
            <excludedMethods>
              <param>*equals</param>
              <param>*hashCode</param>
              <param>*toString</param>
            </excludedMethods>
          </configuration>
          <dependencies>
            <dependency>
              <groupId>org.pitest</groupId>
              <artifactId>pitest-junit5-plugin</artifactId>
              <version>${pitest-junit5-plugin.version}</version>
            </dependency>
          </dependencies>
        </plugin>
        <plugin>
          <groupId>org.revapi</groupId>
          <artifactId>revapi-maven-plugin</artifactId>
          <version>${revapi-maven-plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-resources-plugin</artifactId>
          <version>${maven-resources-plugin.version}</version>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <executions>
          <execution>
            <id>display-info</id>
            <configuration>
              <rules>
                <requireUpperBoundDeps>
                  <level>WARN</level>
                </requireUpperBoundDeps>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <configuration>
          <tagNameFormat>v@{project.version}</tagNameFormat>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <compilerArgs>
            <arg>-Xlint:all</arg>
          </compilerArgs>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <archive>
            <manifestEntries>
              <Built-By>Ullrich Hafner</Built-By>
              <Url>${project.scm.url}</Url>
            </manifestEntries>
          </archive>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>test-jar</goal>
            </goals>
            <configuration>
              <includes>
                <include>**/*Assert*</include>
                <include>**/*PageObject*</include>
              </includes>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <trimStackTrace>false</trimStackTrace>
          <!-- SUREFIRE-1798 -->
          <excludes>
            <exclude>**/*ITest.*</exclude>
            <exclude>**/InjectedTest.*</exclude>
          </excludes>
        </configuration>
        <dependencies>
          <dependency>
            <groupId>com.tngtech.archunit</groupId>
            <artifactId>archunit-junit5-engine</artifactId>
            <version>${archunit.version}</version>
          </dependency>
        </dependencies>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <version>${maven-surefire-plugin.version}</version>
        <configuration>
          <includes>
            <include>**/*ITest.*</include>
            <include>**/*InjectedTest.*</include>
          </includes>
          <reuseForks>false</reuseForks>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <configuration>
          <additionalOptions>-Xdoclint:all</additionalOptions>
          <failOnWarnings>false</failOnWarnings>
          <quiet>true</quiet>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>javadoc</goal>
            </goals>
            <!-- As soon as possible but after required generate-sources phase -->
            <phase>process-sources</phase>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.pitest</groupId>
        <artifactId>pitest-maven</artifactId>
        <version>${pitest-maven.version}</version>
        <configuration>
          <outputFormats>XML,HTML</outputFormats>
          <verbose>true</verbose>
          <targetClasses>
            <param>io.jenkins.plugins.*</param>
          </targetClasses>
          <targetTests>
            <param>io.jenkins.plugins.*</param>
          </targetTests>
          <excludedTestClasses>
            <param>*Assert</param>
            <param>*Assertions</param>
            <param>*ArchitectureTest</param>
            <param>*ITest</param>
            <param>*jmh_generated*</param>
          </excludedTestClasses>
        </configuration>
        <dependencies>
          <dependency>
            <groupId>org.pitest</groupId>
            <artifactId>pitest-junit5-plugin</artifactId>
            <version>${pitest-junit5-plugin.version}</version>
          </dependency>
        </dependencies>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-pmd-plugin</artifactId>
        <version>${maven-pmd-plugin.version}</version>
        <configuration>
          <linkXRef>false</linkXRef>
          <targetJdk>${java.version}</targetJdk>
          <skip>true</skip>
        </configuration>
        <dependencies>
          <dependency>
            <groupId>edu.hm.hafner</groupId>
            <artifactId>pmd-core</artifactId>
            <version>${pmd.version}-metrics-2</version>
          </dependency>
          <dependency>
            <groupId>edu.hm.hafner</groupId>
            <artifactId>pmd-java</artifactId>
            <version>${pmd.version}-metrics-2</version>
          </dependency>
          <dependency>
            <groupId>net.sourceforge.pmd</groupId>
            <artifactId>pmd-javascript</artifactId>
            <version>${pmd.version}</version>
          </dependency>
          <dependency>
            <groupId>edu.hm.hafner</groupId>
            <artifactId>codingstyle</artifactId>
            <version>${codingstyle.config.version}</version>
            <classifier>config</classifier>
          </dependency>
        </dependencies>
        <executions>
          <execution>
            <id>run-pmd-java</id>
            <goals>
              <goal>pmd</goal>
              <goal>check</goal>
              <goal>cpd</goal>
            </goals>
            <phase>verify</phase>
            <configuration>
              <targetDirectory>${project.build.directory}/pmd-java</targetDirectory>
              <rulesets>
                <ruleset>pmd-java-configuration.xml</ruleset>
              </rulesets>
              <includeTests>false</includeTests>
              <minimumTokens>50</minimumTokens>
              <skip>${pmd.skip}</skip>
            </configuration>
          </execution>
          <execution>
            <id>run-pmd-tests</id>
            <goals>
              <goal>pmd</goal>
              <goal>check</goal>
              <goal>cpd</goal>
            </goals>
            <phase>verify</phase>
            <configuration>
              <targetDirectory>${project.build.directory}/pmd-tests</targetDirectory>
              <rulesets>
                <ruleset>pmd-tests-configuration.xml</ruleset>
              </rulesets>
              <includeTests>true</includeTests>
              <minimumTokens>100</minimumTokens>
              <excludeRoots>
                <excludeRoot>src/main/java</excludeRoot>
                <excludeRoot>${project.build.directory}/generated-test-sources/injected</excludeRoot>
                <excludeRoot>${project.build.directory}/generated-test-sources/test-annotations</excludeRoot>
                <excludeRoot>${project.build.directory}/generated-test-sources/assertj-assertions</excludeRoot>
              </excludeRoots>
              <skip>${pmd.skip}</skip>
            </configuration>
          </execution>
          <execution>
            <id>run-pmd-javascript</id>
            <goals>
              <goal>pmd</goal>
              <goal>check</goal>
            </goals>
            <phase>verify</phase>
            <configuration>
              <targetDirectory>${project.build.directory}/pmd-javascript</targetDirectory>
              <rulesets>
                <ruleset>pmd-javascript-configuration.xml</ruleset>
              </rulesets>
              <includeTests>false</includeTests>
              <language>javascript</language>
              <compileSourceRoots>
                <compileSourceRoot>${project.basedir}/src/main/resources</compileSourceRoot>
                <compileSourceRoot>${project.basedir}/src/main/webapp/js</compileSourceRoot>
              </compileSourceRoots>
              <includes>
                <include>**/*.js</include>
              </includes>
              <skip>${pmd.skip}</skip>
            </configuration>
          </execution>
          <execution>
            <id>run-pmd-metrics</id>
            <goals>
              <goal>pmd</goal>
            </goals>
            <phase>verify</phase>
            <configuration>
              <targetDirectory>${project.build.directory}/metrics</targetDirectory>
              <rulesets>
                <ruleset>/category/java/metric.xml</ruleset>
              </rulesets>
              <format>net.sourceforge.pmd.renderers.MetricsRenderer</format>
              <includeTests>false</includeTests>
              <skip>${pmd.skip}</skip>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>${maven-checkstyle-plugin.version}</version>
        <configuration>
          <linkXRef>false</linkXRef>
          <excludeGeneratedSources>true</excludeGeneratedSources>
          <violationSeverity>warning</violationSeverity>
          <excludes>**/*Assert*.java,**/InjectedTest.java,**/Messages.java,**/*_jmh*</excludes>
        </configuration>
        <dependencies>
          <dependency>
            <groupId>com.puppycrawl.tools</groupId>
            <artifactId>checkstyle</artifactId>
            <version>${checkstyle.version}</version>
          </dependency>
          <dependency>
            <groupId>edu.hm.hafner</groupId>
            <artifactId>codingstyle</artifactId>
            <version>${codingstyle.config.version}</version>
            <classifier>config</classifier>
          </dependency>
        </dependencies>
        <executions>
          <execution>
            <id>run-checkstyle-java</id>
            <goals>
              <goal>check</goal>
            </goals>
            <phase>verify</phase>
            <configuration>
              <excludes>**/module-info.java</excludes>
              <includeTestSourceDirectory>false</includeTestSourceDirectory>
              <configLocation>checkstyle-java-configuration.xml</configLocation>
              <outputFile>${project.build.directory}/checkstyle-java/checkstyle-result.xml</outputFile>
            </configuration>
          </execution>
          <execution>
            <id>run-checkstyle-tests</id>
            <goals>
              <goal>check</goal>
            </goals>
            <phase>verify</phase>
            <configuration>
              <excludes>**/*Assert*.java,**/*_jmh*,**/module-info.java</excludes>
              <includeTestSourceDirectory>true</includeTestSourceDirectory>
              <configLocation>checkstyle-tests-configuration.xml</configLocation>
              <outputFile>${project.build.directory}/checkstyle-tests/checkstyle-result.xml</outputFile>
              <sourceDirectories />
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>com.github.spotbugs</groupId>
        <artifactId>spotbugs-maven-plugin</artifactId>
        <configuration>
          <xmlOutput>true</xmlOutput>
          <threshold>Low</threshold>
          <failThreshold>Low</failThreshold>
          <effort>Max</effort>
          <relaxed>false</relaxed>
          <fork>true</fork>
          <excludeFilterFile>spotbugs-exclusion-filter.xml</excludeFilterFile>
          <includeTests>true</includeTests>
          <plugins>
            <plugin>
              <groupId>com.h3xstream.findsecbugs</groupId>
              <artifactId>findsecbugs-plugin</artifactId>
              <version>${findsecbugs-plugin.version}</version>
            </plugin>
          </plugins>
        </configuration>
        <dependencies>
          <dependency>
            <groupId>edu.hm.hafner</groupId>
            <artifactId>codingstyle</artifactId>
            <version>${codingstyle.config.version}</version>
            <classifier>config</classifier>
          </dependency>
          <dependency>
            <groupId>com.github.spotbugs</groupId>
            <artifactId>spotbugs</artifactId>
            <version>${spotbugs.version}</version>
          </dependency>
        </dependencies>
        <executions>
          <execution>
            <id>spotbugs</id>
            <goals>
              <goal>check</goal>
            </goals>
            <phase>verify</phase>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <configuration>
          <includes>
            <include>io/jenkins/plugins/**/*</include>
          </includes>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
            <phase>process-test-classes</phase>
          </execution>
          <execution>
            <id>report</id>
            <goals>
              <goal>report</goal>
            </goals>
            <phase>verify</phase>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.revapi</groupId>
        <artifactId>revapi-maven-plugin</artifactId>
        <version>${revapi-maven-plugin.version}</version>
        <configuration>
          <versionFormat>[-0-9.]*</versionFormat>
          <failBuildOnProblemsFound>true</failBuildOnProblemsFound>
          <pipelineConfiguration>
            <transformBlocks>
              <block>
                <item>manually-vetted</item>
                <item>revapi.versions</item>
              </block>
            </transformBlocks>
          </pipelineConfiguration>
          <analysisConfiguration>
            <revapi.differences id="manually-vetted">
              <attachments>
                <vetted>ok</vetted>
              </attachments>
            </revapi.differences>
            <revapi.versions>
              <enabled>true</enabled>
              <strictSemver>false</strictSemver>
              <onAllowed>
                <criticality>documented</criticality>
                <justification>Allowed by the rules of semantic versioning.</justification>
              </onAllowed>
            </revapi.versions>
            <revapi.filter>
              <elements>
                <exclude>
                  <item>
                    <matcher>java-package</matcher>
                    <match>/org\.jvnet(\..*)?/</match>
                  </item>
                  <item>
                    <matcher>java-package</matcher>
                    <match>/net\.sf\.json(\..*)?/</match>
                  </item>
                  <item>
                    <matcher>java-package</matcher>
                    <match>/hudson(\..*)?/</match>
                  </item>
                  <item>
                    <matcher>java-package</matcher>
                    <match>/org.kohsuke(\..*)?/</match>
                  </item>
                </exclude>
              </elements>
            </revapi.filter>
            <revapi.reporter.json>
              <minSeverity>NON_BREAKING</minSeverity>
              <minCriticality>documented</minCriticality>
              <output>${project.build.directory}/revapi-result.json</output>
              <indent>false</indent>
              <append>false</append>
              <keepEmptyFile>true</keepEmptyFile>
            </revapi.reporter.json>
          </analysisConfiguration>
        </configuration>
        <dependencies>
          <dependency>
            <groupId>org.revapi</groupId>
            <artifactId>revapi-java</artifactId>
            <version>${revapi-java.version}</version>
          </dependency>
          <dependency>
            <groupId>org.revapi</groupId>
            <artifactId>revapi-reporter-json</artifactId>
            <version>${revapi-reporter-json-version}</version>
          </dependency>
          <dependency>
            <groupId>io.jenkins.tools</groupId>
            <artifactId>revapi-hpi-extractor</artifactId>
            <version>1.0.1</version>
          </dependency>
        </dependencies>
        <executions>
          <execution>
            <id>run-revapi</id>
            <goals>
              <goal>check</goal>
            </goals>
            <phase>verify</phase>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>skip</id>
      <properties>
        <maven.javadoc.skip>true</maven.javadoc.skip>
        <pmd.skip>true</pmd.skip>
        <spotbugs.skip>true</spotbugs.skip>
        <checkstyle.skip>true</checkstyle.skip>
        <skipTests>true</skipTests>
        <skipITs>true</skipITs>
        <revapi.skip>true</revapi.skip>
        <enforcer.skip>true</enforcer.skip>
      </properties>
    </profile>
    <profile>
      <id>ci</id>
      <activation>
        <property>
          <name>maven.test.failure.ignore</name>
          <value>true</value>
        </property>
      </activation>
      <properties>
        <maven.test.failure.ignore>true</maven.test.failure.ignore>
        <checkstyle.failOnViolation>false</checkstyle.failOnViolation>
        <pmd.failOnViolation>false</pmd.failOnViolation>
        <spotbugs.failOnError>false</spotbugs.failOnError>
      </properties>
    </profile>
    <profile>
      <id>pit</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.pitest</groupId>
            <artifactId>pitest-maven</artifactId>
            <executions>
              <execution>
                <id>test</id>
                <goals>
                  <goal>mutationCoverage</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>owasp</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.owasp</groupId>
            <artifactId>dependency-check-maven</artifactId>
            <configuration>
              <nvdApiKeyEnvironmentVariable>NVD_API_KEY</nvdApiKeyEnvironmentVariable>
              <format>JSON</format>
            </configuration>
            <executions>
              <execution>
                <goals>
                  <goal>check</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>depgraph</id>
      <build>
        <plugins>
          <plugin>
            <groupId>com.github.ferstl</groupId>
            <artifactId>depgraph-maven-plugin</artifactId>
            <version>${depgraph-maven-plugin.version}</version>
            <configuration>
              <graphFormat>puml</graphFormat>
              <classpathScope>compile</classpathScope>
              <showClassifiers>true</showClassifiers>
              <showVersions>true</showVersions>
              <showConflicts>true</showConflicts>
              <showDuplicates>true</showDuplicates>
              <outputFileName>dependency-graph</outputFileName>
              <outputDirectory>${project.basedir}/doc</outputDirectory>
            </configuration>
            <executions>
              <execution>
                <goals>
                  <goal>graph</goal>
                </goals>
                <phase>verify</phase>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>benchmark</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <excludes>
                <exclude>**/*Test.java</exclude>
              </excludes>
              <includes>
                <include>**/*Benchmark.java</include>
              </includes>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
