<?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>flink-shaded</artifactId>
    <groupId>org.apache.flink</groupId>
    <version>10.0</version>
    <relativePath>../../pom.xml</relativePath>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>flink-shaded-netty-tcnative-dynamic</artifactId>
  <name>flink-shaded-netty-tcnative-dynamic</name>
  <version>${netty.tcnative.version}-10.0</version>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <executions>
          <execution>
            <id>shade-flink</id>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <createDependencyReducedPom>true</createDependencyReducedPom>
              <dependencyReducedPomLocation>${project.basedir}/target/dependency-reduced-pom.xml</dependencyReducedPomLocation>
              <artifactSet>
                <includes>
                  <include>io.netty:netty-tcnative</include>
                </includes>
              </artifactSet>
              <relocations>
                <relocation>
                  <pattern>io.netty</pattern>
                  <shadedPattern>${shading.prefix}.netty4.io.netty</shadedPattern>
                </relocation>
              </relocations>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>3.1.1</version>
        <executions>
          <execution>
            <id>copy</id>
            <phase>package</phase>
            <goals>
              <goal>copy</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <artifactItems>
            <artifactItem>
              <groupId>io.netty</groupId>
              <artifactId>netty-tcnative</artifactId>
              <version>${netty.tcnative.version}</version>
              <classifier>linux-x86_64</classifier>
              <type>jar</type>
              <overWrite>false</overWrite>
              <outputDirectory>${project.build.directory}/native_libs</outputDirectory>
            </artifactItem>
            <artifactItem>
              <groupId>io.netty</groupId>
              <artifactId>netty-tcnative</artifactId>
              <version>${netty.tcnative.version}</version>
              <classifier>linux-loongarch_64</classifier>
              <type>jar</type>
              <overWrite>false</overWrite>
              <outputDirectory>${project.build.directory}/native_libs</outputDirectory>
            </artifactItem>
            <artifactItem>
              <groupId>io.netty</groupId>
              <artifactId>netty-tcnative</artifactId>
              <version>${netty.tcnative.version}</version>
              <classifier>linux-x86_64-fedora</classifier>
              <type>jar</type>
              <overWrite>false</overWrite>
              <outputDirectory>${project.build.directory}/native_libs</outputDirectory>
            </artifactItem>
            <artifactItem>
              <groupId>io.netty</groupId>
              <artifactId>netty-tcnative</artifactId>
              <version>${netty.tcnative.version}</version>
              <classifier>osx-x86_64</classifier>
              <type>jar</type>
              <overWrite>false</overWrite>
              <outputDirectory>${project.build.directory}/native_libs</outputDirectory>
            </artifactItem>
            <artifactItem>
              <groupId>io.netty</groupId>
              <artifactId>netty-tcnative</artifactId>
              <version>${netty.tcnative.version}</version>
              <classifier>windows-x86_64</classifier>
              <type>jar</type>
              <overWrite>false</overWrite>
              <outputDirectory>${project.build.directory}/native_libs</outputDirectory>
            </artifactItem>
          </artifactItems>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <version>1.7</version>
        <executions>
          <execution>
            <id>rename-native-library</id>
            <phase>package</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <target>
                <echo />
                <unzip />
                <echo />
                <unzip />
                <move>
                  <fileset />
                  <mapper />
                </move>
                <delete />
                <unzip />
                <move>
                  <fileset />
                  <mapper />
                </move>
                <delete />
                <unzip />
                <move>
                  <fileset />
                  <mapper />
                </move>
                <delete />
                <unzip />
                <move>
                  <fileset />
                  <mapper />
                </move>
                <delete />
                <unzip />
                <move>
                  <fileset />
                  <mapper />
                </move>
                <delete />
                <echo />
                <jar />
              </target>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <properties>
    <netty.tcnative.version>2.0.30.Final</netty.tcnative.version>
  </properties>
</project>
