<?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">
  <parent>
    <artifactId>opendst</artifactId>
    <groupId>com.pingidentity.opendst</groupId>
    <version>0.1.1</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>opendst-maven-plugin</artifactId>
  <packaging>maven-plugin</packaging>
  <name>OpenDST Maven Plugin</name>
  <description>Maven plugin for running OpenDST deterministic simulation tests</description>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-plugin-plugin</artifactId>
        <version>3.15.2</version>
      </plugin>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <version>3.6.1</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <artifactSet>
                <includes>
                  <include>com.pingidentity.opendst:opendst-common</include>
                </includes>
              </artifactSet>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>3.8.1</version>
        <executions>
          <execution>
            <id>copy-embedded-jars</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>copy</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>com.pingidentity.opendst</groupId>
                  <artifactId>opendst-agent</artifactId>
                  <version>${project.version}</version>
                  <destFileName>opendst-agent.jar</destFileName>
                </artifactItem>
                <artifactItem>
                  <groupId>com.pingidentity.opendst</groupId>
                  <artifactId>opendst-runner</artifactId>
                  <version>${project.version}</version>
                  <destFileName>opendst-runner.jar</destFileName>
                </artifactItem>
              </artifactItems>
              <outputDirectory>${project.build.outputDirectory}/META-INF/agents</outputDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-invoker-plugin</artifactId>
        <version>3.9.1</version>
        <executions>
          <execution>
            <id>integration-test</id>
            <phase>integration-test</phase>
            <goals>
              <goal>install</goal>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
          <pomIncludes>
            <pomInclude>*/pom.xml</pomInclude>
          </pomIncludes>
          <postBuildHookScript>verify</postBuildHookScript>
          <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
          <settingsFile>src/it/settings.xml</settingsFile>
          <extraArtifacts>
            <extraArtifact>com.pingidentity.opendst:opendst-agent:${project.version}:jar</extraArtifact>
            <extraArtifact>com.pingidentity.opendst:opendst-sdk:${project.version}:jar</extraArtifact>
          </extraArtifacts>
          <properties>
            <spotless.ratchet.ref />
            <spotless.check.skip>${spotless.check.skip}</spotless.check.skip>
            <spotless.license-header.path>${maven.multiModuleProjectDirectory}/license-header</spotless.license-header.path>
          </properties>
          <skipInvocation>${skipTests}</skipInvocation>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-source-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-javadoc-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <release>25</release>
              <notimestamp>true</notimestamp>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
  <dependencies>
    <dependency>
      <groupId>tools.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
      <version>3.1.0</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>tools.jackson.dataformat</groupId>
      <artifactId>jackson-dataformat-yaml</artifactId>
      <version>3.1.0</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-core</artifactId>
      <version>3.9.12</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-plugin-api</artifactId>
      <version>3.9.12</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.plugin-tools</groupId>
      <artifactId>maven-plugin-annotations</artifactId>
      <version>3.15.2</version>
      <scope>provided</scope>
    </dependency>
  </dependencies>
</project>
