<?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 https://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>io.jenkins.configuration-as-code</groupId>
    <artifactId>parent</artifactId>
    <version>${changelist}</version>
  </parent>

  <artifactId>test-harness</artifactId>
  <name>Configuration as Code Test harness</name>
  <description>Functionality to make testing jcasc integration easier</description>

  <properties>
    <spotbugs.skip>true</spotbugs.skip>
  </properties>

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

  <dependencies>
    <dependency>
      <groupId>com.github.erosb</groupId>
      <artifactId>everit-json-schema</artifactId>
      <version>1.14.6</version>
    </dependency>
    <dependency>
      <groupId>com.github.stefanbirkner</groupId>
      <artifactId>system-rules</artifactId>
      <version>1.19.0</version>
      <exclusions>
        <exclusion>
          <groupId>junit</groupId>
          <artifactId>junit-dep</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>com.vladsch.flexmark</groupId>
      <artifactId>flexmark-all</artifactId>
      <version>0.64.8</version>
      <exclusions>
        <exclusion>
          <groupId>org.jetbrains</groupId>
          <artifactId>annotations</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>io.jenkins</groupId>
      <artifactId>configuration-as-code</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.main</groupId>
      <artifactId>jenkins-test-harness</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>jackson2-api</artifactId>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <executions>
          <execution>
            <id>display-info</id>
            <configuration>
              <rules>
                <bannedDependencies>
                  <includes combine.children="append">
                    <include>org.jenkins-ci.main:jenkins-test-harness</include>
                  </includes>
                </bannedDependencies>
                <requireUpperBoundDeps>
                  <excludes combine.children="append">
                    <exclude>org.json:json</exclude>
                  </excludes>
                </requireUpperBoundDeps>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.jenkins-ci.tools</groupId>
        <artifactId>maven-hpi-plugin</artifactId>
        <extensions>true</extensions>
        <executions>
          <execution>
            <id>prepare-test-plugins</id>
            <goals>
              <goal>resolve-test-dependencies</goal>
            </goals>
            <phase>test-compile</phase>
          </execution>
          <execution>
            <id>test-runtime</id>
            <goals>
              <goal>test-runtime</goal>
            </goals>
            <phase>test</phase>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
