<?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>observability-kit</artifactId>
    <groupId>com.vaadin</groupId>
    <version>4.1-SNAPSHOT</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>observability-kit-agent</artifactId>
  <name>Observability Kit Agent</name>
  <build>
    <testResources>
      <testResource>
        <filtering>true</filtering>
        <directory>src/test/resources</directory>
      </testResource>
    </testResources>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <useIncrementalCompilation>false</useIncrementalCompilation>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <forceCreation>true</forceCreation>
        </configuration>
      </plugin>
      <plugin>
        <groupId>net.bytebuddy</groupId>
        <artifactId>byte-buddy-maven-plugin</artifactId>
        <version>${byte-buddy.version}</version>
        <executions>
          <execution>
            <goals>
              <goal>transform</goal>
            </goals>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>io.opentelemetry.javaagent</groupId>
            <artifactId>opentelemetry-muzzle</artifactId>
            <version>${opentelemetry.javaagent.version}-alpha</version>
          </dependency>
          <dependency>
            <groupId>com.google.auto.service</groupId>
            <artifactId>auto-service</artifactId>
            <version>${google.auto-service.version}</version>
          </dependency>
        </dependencies>
        <configuration>
          <source>21</source>
          <target>21</target>
          <transformations>
            <transformation>
              <plugin>com.vaadin.extension.ClasspathByteBuddyPlugin</plugin>
            </transformation>
          </transformations>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <version>${maven.shade.version}</version>
        <executions>
          <execution>
            <id>create-extension-artifact</id>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <finalName>${extension.name}-${project.version}</finalName>
              <artifactSet>
                <excludes>
                  <exclude>io.opentelemetry.javaagent:opentelemetry-javaagent</exclude>
                </excludes>
              </artifactSet>
            </configuration>
          </execution>
          <execution>
            <id>create-agent-artifact</id>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <artifactSet>
                <excludes>
                  <exclude>${project.groupId}:${project.artifactId}</exclude>
                </excludes>
                <includes>
                  <include>io.opentelemetry.javaagent:opentelemetry-javaagent</include>
                </includes>
              </artifactSet>
              <transformers>
                <transformer>
                  <resource>extensions/${extension.name}-${project.version}.jar</resource>
                  <file>${project.build.directory}/${extension.name}-${project.version}.jar</file>
                </transformer>
                <transformer>
                  <manifestEntries>
                    <Implementation-Version>${opentelemetry.version}~vaadin-${project.version}</Implementation-Version>
                  </manifestEntries>
                </transformer>
              </transformers>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <dependencies>
    <dependency>
      <groupId>jakarta.servlet</groupId>
      <artifactId>jakarta.servlet-api</artifactId>
      <version>6.0.0</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>jakarta.annotation</groupId>
      <artifactId>jakarta.annotation-api</artifactId>
      <version>2.1.1</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.vaadin</groupId>
      <artifactId>flow-data</artifactId>
      <version>25.1-SNAPSHOT</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.vaadin</groupId>
      <artifactId>hilla-endpoint</artifactId>
      <version>25.1-SNAPSHOT</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.google.auto.service</groupId>
      <artifactId>auto-service</artifactId>
      <version>1.1.1</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>net.bytebuddy</groupId>
      <artifactId>byte-buddy</artifactId>
      <version>1.18.7</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.opentelemetry.instrumentation</groupId>
      <artifactId>opentelemetry-instrumentation-api</artifactId>
      <version>2.26.1</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>io.opentelemetry.semconv</groupId>
      <artifactId>opentelemetry-semconv</artifactId>
      <version>1.40.0</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>io.opentelemetry.javaagent</groupId>
      <artifactId>opentelemetry-javaagent-extension-api</artifactId>
      <version>2.26.1-alpha</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>io.opentelemetry.javaagent</groupId>
      <artifactId>opentelemetry-javaagent-tooling</artifactId>
      <version>2.26.1-alpha</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
      <version>3.18.0</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>2.0.17</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
      <version>5.9.2</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>junit-jupiter-api</artifactId>
          <groupId>org.junit.jupiter</groupId>
        </exclusion>
        <exclusion>
          <artifactId>junit-jupiter-params</artifactId>
          <groupId>org.junit.jupiter</groupId>
        </exclusion>
        <exclusion>
          <artifactId>junit-jupiter-engine</artifactId>
          <groupId>org.junit.jupiter</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <version>5.20.0</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>byte-buddy-agent</artifactId>
          <groupId>net.bytebuddy</groupId>
        </exclusion>
        <exclusion>
          <artifactId>objenesis</artifactId>
          <groupId>org.objenesis</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest</artifactId>
      <version>2.2</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.opentelemetry</groupId>
      <artifactId>opentelemetry-sdk-testing</artifactId>
      <version>1.60.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <properties>
    <byte-buddy.version>1.18.7</byte-buddy.version>
    <extension.name>opentelemetry-vaadin-observability-instrumentation-extension</extension.name>
    <google.auto-service.version>1.1.1</google.auto-service.version>
  </properties>
</project>
