<?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>pulsar-protocol-handler-kafka-parent</artifactId>
    <groupId>io.streamnative.pulsar.handlers</groupId>
    <version>4.2.1.4</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <groupId>io.streamnative.pulsar.handlers</groupId>
  <artifactId>oauth-client</artifactId>
  <name>Oauth client</name>
  <description>Shaded OAuth client for Kafka on Pulsar with relocated Jackson dependencies.</description>
  <url>https://github.com/streamnative/ksn</url>
  <developers>
    <developer>
      <organization>StreamNative</organization>
      <organizationUrl>https://streamnative.io/</organizationUrl>
    </developer>
  </developers>
  <licenses>
    <license>
      <name>Apache License, Version 2.0</name>
      <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <scm>
    <connection>scm:git:https://github.com/streamnative/ksn.git</connection>
    <developerConnection>scm:git:https://github.com/streamnative/ksn.git</developerConnection>
    <url>https://github.com/streamnative/ksn</url>
  </scm>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>unpack</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>unpack</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>io.streamnative.pulsar.handlers</groupId>
                  <artifactId>oauth-client-original</artifactId>
                  <version>${project.version}</version>
                  <type>jar</type>
                  <overWrite>true</overWrite>
                  <includes>**/*</includes>
                  <outputDirectory>${project.build.directory}/classes</outputDirectory>
                </artifactItem>
              </artifactItems>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <version>${maven-shade-plugin.version}</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <createDependencyReducedPom>true</createDependencyReducedPom>
              <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
              <minimizeJar>false</minimizeJar>
              <artifactSet>
                <includes>
                  <include>com.fasterxml.jackson.core:*</include>
                  <include>io.streamnative.pulsar.handlers:*</include>
                </includes>
              </artifactSet>
              <filters>
                <filter>
                  <artifact>com.fasterxml.jackson.core:*</artifact>
                  <excludes>
                    <exclude>META-INF/**</exclude>
                  </excludes>
                </filter>
              </filters>
              <relocations>
                <relocation>
                  <pattern>com.fasterxml.jackson</pattern>
                  <shadedPattern>io.streamnative.pulsar.shade.com.fasterxml.jackson</shadedPattern>
                </relocation>
              </relocations>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
          <execution>
            <id>default-jar</id>
            <phase>package</phase>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
          <execution>
            <id>javadoc-jar</id>
            <phase>package</phase>
            <goals>
              <goal>jar</goal>
            </goals>
            <configuration>
              <classifier>javadoc</classifier>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
