<?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>openmetadata-shaded-deps</artifactId>
    <groupId>org.open-metadata</groupId>
    <version>1.3.2</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>elasticsearch-deps</artifactId>
  <name>Shaded Deps for OpenMetadata Server</name>
  <description>Shaded version of dependencies used only for internal OpenMetadata code.</description>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <version>3.5.1</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <keepDependenciesWithProvidedScope>false</keepDependenciesWithProvidedScope>
          <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
          <minimizeJar>false</minimizeJar>
          <artifactSet>
            <includes>
              <include>*:*</include>
            </includes>
          </artifactSet>
          <relocations>
            <relocation>
              <pattern>org.elasticsearch</pattern>
              <shadedPattern>es.org.elasticsearch</shadedPattern>
            </relocation>
            <relocation>
              <pattern>org.elasticsearch.client</pattern>
              <shadedPattern>es.org.elasticsearch.client</shadedPattern>
            </relocation>
            <relocation>
              <pattern>org.apache.lucene</pattern>
              <shadedPattern>es.org.apache.lucene</shadedPattern>
            </relocation>
            <relocation>
              <pattern>META-INF/versions/9/org/apache/logging/log4j/</pattern>
              <shadedPattern>org/apache/logging/log4j/</shadedPattern>
            </relocation>
          </relocations>
          <filters>
            <filter>
              <artifact>*:*</artifact>
              <excludes>
                <exclude>META-INF/*.SF</exclude>
                <exclude>META-INF/*.sf</exclude>
                <exclude>META-INF/*.DSA</exclude>
                <exclude>META-INF/*.dsa</exclude>
                <exclude>META-INF/*.RSA</exclude>
                <exclude>META-INF/*.rsa</exclude>
                <exclude>META-INF/*.EC</exclude>
                <exclude>META-INF/*.ec</exclude>
                <exclude>META-INF/MSFTSIG.SF</exclude>
                <exclude>META-INF/MSFTSIG.RSA</exclude>
                <exclude>META-INF/LICENSE.txt</exclude>
                <exclude>META-INF/NOTICE.txt</exclude>
              </excludes>
            </filter>
          </filters>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>3.4.0</version>
        <executions>
          <execution>
            <id>workaround-makeItVisibleOnIntellij</id>
            <phase>none</phase>
            <goals>
              <goal>attach-artifact</goal>
            </goals>
            <configuration>
              <artifacts>
                <artifact>
                  <file>${project.build.directory}/${project.build.finalName}.jar</file>
                  <type>jar</type>
                  <classifier>optional</classifier>
                </artifact>
              </artifacts>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-source-plugin</artifactId>
            <version>3.3.0</version>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>3.6.0</version>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
                <configuration>
                  <doclint>none</doclint>
                </configuration>
              </execution>
            </executions>
            <configuration>
              <doclint>none</doclint>
            </configuration>
          </plugin>
          <plugin>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>3.0.1</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
                <configuration>
                  <gpgArguments>
                    <arg>--pinentry-mode</arg>
                    <arg>loopback</arg>
                  </gpgArguments>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
