<?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">
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.opensearch.client</groupId>
  <artifactId>opensearch-rest-high-level-client</artifactId>
  <name>OpenSearch rest-high-level-client shaded</name>
  <version>${opensearch.version}-atlassian-shaded-2</version>
  <scm>
    <connection>scm:git:ssh://git@bitbucket.org:atlassian/opensearch-shaded.git</connection>
    <developerConnection>scm:git:ssh://git@bitbucket.org:atlassian/opensearch-shaded.git</developerConnection>
    <url>https://bitbucket.org/atlassian/opensearch-shaded</url>
  </scm>
  <build>
    <sourceDirectory>${project.build.directory}/sources</sourceDirectory>
    <plugins>
      <plugin>
        <groupId>com.atlassian.maven.plugins</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <version>1.0.0</version>
        <executions>
          <execution>
            <id>download-licenses</id>
            <phase>package</phase>
            <goals>
              <goal>download</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <licensesDirectory>${license.licensesDirectory}</licensesDirectory>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>2.10</version>
        <executions>
          <execution>
            <id>unpack-sources-for-dependencies</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>unpack-dependencies</goal>
            </goals>
            <configuration>
              <includeArtifactIds>opensearch-rest-high-level-client,opensearch-rest-client,opensearch,lucene-core,lucene-analysis-common,lucene-backward-codecs,lucene-grouping,lucene-highlighter,lucene-join,lucene-memory,lucene-misc,lucene-queries,lucene-queryparser,lucene-sandbox,lucene-spatial-extras,lucene-spatial3d,lucene-suggest,opensearch-cli,httpclient</includeArtifactIds>
              <classifier>sources</classifier>
              <failOnMissingClassifierArtifact>true</failOnMissingClassifierArtifact>
              <outputDirectory>${project.build.directory}/sources</outputDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <version>3.4.1</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <shadedClassifierName>shaded</shadedClassifierName>
              <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
              <artifactSet>
                <excludes>
                  <exclude>net.java.dev.jna:jna</exclude>
                  <exclude>org.apache.logging.log4j:*</exclude>
                  <exclude>org.apache.httpcomponents:*</exclude>
                </excludes>
              </artifactSet>
              <filters>
                <filter>
                  <artifact>*:*</artifact>
                  <excludes>
                    <exclude>**/module-info.class</exclude>
                    <exclude>META-INF/versions/**</exclude>
                  </excludes>
                </filter>
              </filters>
              <relocations>
                <relocation>
                  <pattern>org.apache.lucene</pattern>
                  <shadedPattern>com.atlassian.opensearch.shaded.lucene</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.tartarus.snowball</pattern>
                  <shadedPattern>com.atlassian.opensearch.shaded.tartarus.snowball</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.joda</pattern>
                  <shadedPattern>com.atlassian.opensearch.shaded.joda</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.yaml</pattern>
                  <shadedPattern>com.atlassian.opensearch.shaded.yaml</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.apache.commons</pattern>
                  <shadedPattern>com.atlassian.opensearch.shaded.commons</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.HdrHistogram</pattern>
                  <shadedPattern>com.atlassian.opensearch.shaded.HdrHistogram</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>com.fasterxml</pattern>
                  <shadedPattern>com.atlassian.opensearch.shaded.fasterxml</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>com.carrotsearch</pattern>
                  <shadedPattern>com.atlassian.opensearch.shaded.carrotsearch</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>com.tdunning</pattern>
                  <shadedPattern>com.atlassian.opensearch.shaded.tdunning</shadedPattern>
                </relocation>
              </relocations>
              <transformers>
                <transformer />
                <transformer />
              </transformers>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <version>1.6</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <tasks>
                <echo />
                <unzip />
                <echo />
                <move>
                  <fileset />
                  <mapper />
                </move>
                <move>
                  <fileset />
                  <mapper />
                </move>
                <replaceregexp>
                  <fileset />
                  <fileset />
                </replaceregexp>
                <replaceregexp>
                  <fileset />
                  <fileset />
                </replaceregexp>
                <zip />
              </tasks>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-source-plugin</artifactId>
        <version>2.4</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <phase>verify</phase>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.3</version>
        <configuration>
          <skipMain>true</skipMain>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <dependencies>
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-api</artifactId>
      <version>2.17.1</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-jul</artifactId>
      <version>2.17.1</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>net.java.dev.jna</groupId>
      <artifactId>jna</artifactId>
      <version>5.5.0</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpclient</artifactId>
      <version>4.5.13</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpcore</artifactId>
      <version>4.4.15</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpasyncclient</artifactId>
      <version>4.1.5</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpcore-nio</artifactId>
      <version>4.4.15</version>
      <scope>compile</scope>
    </dependency>
  </dependencies>
  <distributionManagement>
    <repository>
      <id>maven-atlassian-com</id>
      <name>Atlassian Private Repository</name>
      <url>https://packages.atlassian.com/maven/3rdparty</url>
    </repository>
    <snapshotRepository>
      <id>maven-atlassian-com</id>
      <name>Atlassian Private Snapshot Repository</name>
      <url>https://packages.atlassian.com/maven/3rdparty-snapshot</url>
    </snapshotRepository>
  </distributionManagement>
  <properties>
    <maven.compiler.target>${maven.compiler.source}</maven.compiler.target>
    <opensearch.version>2.8.0</opensearch.version>
    <license.licensesDirectory>${project.build.directory}/jar/META-INF/license</license.licensesDirectory>
    <maven.compiler.source>11</maven.compiler.source>
  </properties>
</project>
