<?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>graylog-shaded</artifactId>
    <groupId>org.graylog.shaded</groupId>
    <version>1.0.11</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>lucene9</artifactId>
  <name>Lucene 9 (shaded)</name>
  <version>9.12.3-1</version>
  <description>Lucene 9 relocated into org.graylog.shaded.lucene9 so that it can coexist with Lucene 10 on the same
        classpath. Lucene only reads indices of the current and the previous major version, so Lucene 10 alone
        cannot open Lucene 8 segments (OpenSearch 1.x / Elasticsearch 7.x). The data node uses this artifact to
        still detect and report such index directories instead of failing with an unspecific error.</description>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <executions>
          <execution>
            <id>relocate-lucene9</id>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <createDependencyReducedPom>true</createDependencyReducedPom>
              <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
              <shadeSourcesContent>true</shadeSourcesContent>
              <createSourcesJar>true</createSourcesJar>
              <artifactSet>
                <includes>
                  <include>org.apache.lucene:lucene-core</include>
                  <include>org.apache.lucene:lucene-backward-codecs</include>
                </includes>
              </artifactSet>
              <filters>
                <filter>
                  <artifact>*:*</artifact>
                  <excludes>
                    <exclude>module-info.class</exclude>
                    <exclude>META-INF/versions/*/module-info.class</exclude>
                  </excludes>
                </filter>
              </filters>
              <transformers>
                <transformer />
                <transformer>
                  <resource>META-INF/LICENSE</resource>
                </transformer>
                <transformer>
                  <resource>META-INF/LICENSE.txt</resource>
                </transformer>
                <transformer>
                  <resource>META-INF/NOTICE</resource>
                </transformer>
                <transformer>
                  <resource>META-INF/NOTICE.txt</resource>
                </transformer>
                <transformer>
                  <manifestEntries>
                    <Multi-Release>true</Multi-Release>
                  </manifestEntries>
                </transformer>
              </transformers>
              <relocations>
                <relocation>
                  <pattern>org.apache.lucene</pattern>
                  <shadedPattern>org.graylog.shaded.lucene9.org.apache.lucene</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>META-INF/versions/19/org.apache.lucene</pattern>
                  <shadedPattern>META-INF/versions/19/org.graylog.shaded.lucene9.org.apache.lucene</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>META-INF/versions/20/org.apache.lucene</pattern>
                  <shadedPattern>META-INF/versions/20/org.graylog.shaded.lucene9.org.apache.lucene</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>META-INF/versions/21/org.apache.lucene</pattern>
                  <shadedPattern>META-INF/versions/21/org.graylog.shaded.lucene9.org.apache.lucene</shadedPattern>
                </relocation>
              </relocations>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <properties>
    <lucene9.version>9.12.3</lucene9.version>
  </properties>
</project>
