<?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>apm-agent-parent</artifactId>
    <groupId>co.elastic.apm</groupId>
    <version>1.26.2</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>apm-agent-attach-cli</artifactId>
  <name>${project.groupId}:${project.artifactId}</name>
  <licenses>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
    </license>
  </licenses>
  <build>
    <plugins>
      <plugin>
        <groupId>com.coderplus.maven.plugins</groupId>
        <artifactId>copy-rename-maven-plugin</artifactId>
        <version>1.0</version>
        <executions>
          <execution>
            <id>copy-file</id>
            <phase>process-resources</phase>
            <goals>
              <goal>copy</goal>
            </goals>
            <configuration>
              <sourceFile>${project.basedir}/Bouncy-Castle-NOTICE</sourceFile>
              <destinationFile>target/classes/META-INF/Bouncy-Castle-NOTICE</destinationFile>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
          <execution>
            <id>package-bouncy-castle-verifier</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>jar</goal>
            </goals>
            <configuration>
              <classifier>bc-verifier</classifier>
              <includes>
                <include>co/elastic/apm/attach/bouncycastle/BouncyCastleVerifier.class</include>
              </includes>
              <outputDirectory>${project.basedir}/target/classes/bc-lib</outputDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>copy-bouncy-castle-jars</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>copy</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>org.bouncycastle</groupId>
                  <artifactId>bcpg-fips</artifactId>
                  <version>${version.bouncy-castle.bcpg-fips}</version>
                  <type>jar</type>
                  <destFileName>bcpg-fips.jar</destFileName>
                </artifactItem>
                <artifactItem>
                  <groupId>org.bouncycastle</groupId>
                  <artifactId>bc-fips</artifactId>
                  <version>${version.bouncy-castle.bc-fips}</version>
                  <type>jar</type>
                  <destFileName>bc-fips.jar</destFileName>
                </artifactItem>
              </artifactItems>
              <outputDirectory>${project.basedir}/target/classes/bc-lib</outputDirectory>
            </configuration>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>org.bouncycastle</groupId>
            <artifactId>bcpg-fips</artifactId>
            <version>${version.bouncy-castle.bcpg-fips}</version>
          </dependency>
          <dependency>
            <groupId>org.bouncycastle</groupId>
            <artifactId>bc-fips</artifactId>
            <version>${version.bouncy-castle.bc-fips}</version>
          </dependency>
        </dependencies>
      </plugin>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <executions>
          <execution>
            <id>cli</id>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <shadedArtifactAttached>true</shadedArtifactAttached>
              <createSourcesJar>true</createSourcesJar>
              <shadeSourcesContent>true</shadeSourcesContent>
              <shadedArtifactAttached>false</shadedArtifactAttached>
              <keepDependenciesWithProvidedScope>true</keepDependenciesWithProvidedScope>
              <createDependencyReducedPom>true</createDependencyReducedPom>
              <filters>
                <filter>
                  <artifact>*:*</artifact>
                  <excludes>
                    <exclude>co/elastic/apm/attach/bouncycastle/BouncyCastleVerifier.class</exclude>
                  </excludes>
                </filter>
              </filters>
              <transformers>
                <transformer>
                  <manifestEntries>
                    <Main-Class>co.elastic.apm.attach.AgentAttacher</Main-Class>
                  </manifestEntries>
                </transformer>
                <transformer />
                <transformer />
                <transformer>
                  <resource>META-INF/LICENSE</resource>
                  <file>${apm-agent-parent.base.dir}/LICENSE</file>
                </transformer>
              </transformers>
            </configuration>
          </execution>
          <execution>
            <id>cli-slim</id>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <shadedArtifactAttached>true</shadedArtifactAttached>
              <shadedClassifierName>slim</shadedClassifierName>
              <createSourcesJar>true</createSourcesJar>
              <shadeSourcesContent>true</shadeSourcesContent>
              <filters>
                <filter>
                  <artifact>*:*</artifact>
                  <excludes>
                    <exclude>elastic-apm-agent.jar</exclude>
                    <exclude>co/elastic/apm/attach/bouncycastle/BouncyCastleVerifier.class</exclude>
                  </excludes>
                </filter>
                <filter>
                  <artifact>org.apache.logging.log4j:log4j-core</artifact>
                  <excludes>
                    <exclude>org/apache/logging/log4j/core/appender/SmtpAppender.class</exclude>
                  </excludes>
                </filter>
              </filters>
              <transformers>
                <transformer>
                  <manifestEntries>
                    <Main-Class>co.elastic.apm.attach.AgentAttacher</Main-Class>
                  </manifestEntries>
                </transformer>
                <transformer />
                <transformer />
                <transformer>
                  <resource>META-INF/LICENSE</resource>
                  <file>${apm-agent-parent.base.dir}/LICENSE</file>
                </transformer>
              </transformers>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <dependencies>
    <dependency>
      <groupId>co.elastic.apm</groupId>
      <artifactId>apm-agent-attach</artifactId>
      <version>1.26.2</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-core</artifactId>
      <version>2.12.4</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>co.elastic.logging</groupId>
      <artifactId>log4j2-ecs-layout</artifactId>
      <version>1.3.2</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.bouncycastle</groupId>
      <artifactId>bcpg-fips</artifactId>
      <version>1.0.5.1</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.bouncycastle</groupId>
      <artifactId>bc-fips</artifactId>
      <version>1.0.2.1</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.codehaus.mojo</groupId>
      <artifactId>animal-sniffer-annotations</artifactId>
      <version>1.17</version>
      <scope>provided</scope>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>com.google.code.findbugs</groupId>
      <artifactId>jsr305</artifactId>
      <version>3.0.2</version>
      <scope>provided</scope>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-api</artifactId>
      <version>5.7.2</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>apiguardian-api</artifactId>
          <groupId>org.apiguardian</groupId>
        </exclusion>
        <exclusion>
          <artifactId>opentest4j</artifactId>
          <groupId>org.opentest4j</groupId>
        </exclusion>
        <exclusion>
          <artifactId>junit-platform-commons</artifactId>
          <groupId>org.junit.platform</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-engine</artifactId>
      <version>5.7.2</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>junit-platform-engine</artifactId>
          <groupId>org.junit.platform</groupId>
        </exclusion>
        <exclusion>
          <artifactId>apiguardian-api</artifactId>
          <groupId>org.apiguardian</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-params</artifactId>
      <version>5.7.2</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>apiguardian-api</artifactId>
          <groupId>org.apiguardian</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.13.2</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>hamcrest-core</artifactId>
          <groupId>org.hamcrest</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.junit.vintage</groupId>
      <artifactId>junit-vintage-engine</artifactId>
      <version>5.7.2</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>junit-platform-engine</artifactId>
          <groupId>org.junit.platform</groupId>
        </exclusion>
        <exclusion>
          <artifactId>apiguardian-api</artifactId>
          <groupId>org.apiguardian</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <version>3.20.2</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <version>3.12.4</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>byte-buddy</artifactId>
          <groupId>net.bytebuddy</groupId>
        </exclusion>
        <exclusion>
          <artifactId>objenesis</artifactId>
          <groupId>org.objenesis</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>com.networknt</groupId>
      <artifactId>json-schema-validator</artifactId>
      <version>1.0.58</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>slf4j-api</artifactId>
          <groupId>org.slf4j</groupId>
        </exclusion>
        <exclusion>
          <artifactId>commons-lang3</artifactId>
          <groupId>org.apache.commons</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
      <version>[2.10.0,)</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>jackson-annotations</artifactId>
          <groupId>com.fasterxml.jackson.core</groupId>
        </exclusion>
        <exclusion>
          <artifactId>jackson-core</artifactId>
          <groupId>com.fasterxml.jackson.core</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>com.github.tomakehurst</groupId>
      <artifactId>wiremock-standalone</artifactId>
      <version>2.27.2</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.awaitility</groupId>
      <artifactId>awaitility</artifactId>
      <version>4.1.0</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>hamcrest</artifactId>
          <groupId>org.hamcrest</groupId>
        </exclusion>
      </exclusions>
    </dependency>
  </dependencies>
  <properties>
    <version.bouncy-castle.bcpg-fips>1.0.5.1</version.bouncy-castle.bcpg-fips>
    <apm-agent-parent.base.dir>${project.basedir}/..</apm-agent-parent.base.dir>
    <version.bouncy-castle.bc-fips>1.0.2.1</version.bouncy-castle.bc-fips>
  </properties>
</project>
