blob: 70716843b0557cd34f745d23edb5e6c83c917eda [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. See accompanying LICENSE file.
-->
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.ratis</groupId>
<artifactId>ratis-thirdparty</artifactId>
<version>1.0.2</version>
</parent>
<artifactId>ratis-thirdparty-misc</artifactId>
<name>Apache Ratis Thirdparty Miscellaneous</name>
<packaging>jar</packaging>
<description>Miscellaneous thirdparty dependencies for Apache Ratis</description>
<dependencies>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
</dependency>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java-util</artifactId>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-netty</artifactId>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-protobuf</artifactId>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-stub</artifactId>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-context</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-resolver-dns-native-macos</artifactId>
<classifier>osx-x86_64</classifier>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport-native-epoll</artifactId>
<classifier>linux-aarch_64</classifier>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport-native-epoll</artifactId>
<classifier>linux-x86_64</classifier>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport-native-kqueue</artifactId>
<classifier>osx-x86_64</classifier>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-tcnative-boringssl-static</artifactId>
</dependency>
<dependency>
<groupId>io.opencensus</groupId>
<artifactId>opencensus-api</artifactId>
</dependency>
<dependency>
<groupId>io.opencensus</groupId>
<artifactId>opencensus-contrib-grpc-metrics</artifactId>
</dependency>
<dependency>
<groupId>io.dropwizard.metrics</groupId>
<artifactId>metrics-core</artifactId>
</dependency>
<dependency>
<groupId>io.dropwizard.metrics</groupId>
<artifactId>metrics-jvm</artifactId>
</dependency>
<dependency>
<groupId>io.dropwizard.metrics</groupId>
<artifactId>metrics-jmx</artifactId>
</dependency>
<dependency>
<groupId>io.dropwizard.metrics</groupId>
<artifactId>metrics-ganglia</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<shadeSourcesContent>true</shadeSourcesContent>
<createSourcesJar>true</createSourcesJar>
<!-- Replace the original artifact which is no good on its own -->
<shadedArtifactAttached>false</shadedArtifactAttached>
<dependencyReducedPomLocation>${project.build.directory}/dependency-reduced-pom.xml</dependencyReducedPomLocation>
<relocations>
<relocation>
<pattern>com.google.cloud.audit</pattern>
<shadedPattern>${ratis.thirdparty.shaded.prefix}.com.google.cloud.audit</shadedPattern>
</relocation>
<relocation>
<pattern>com.google.common</pattern>
<shadedPattern>${ratis.thirdparty.shaded.prefix}.com.google.common</shadedPattern>
</relocation>
<relocation>
<pattern>com.google.logging.type</pattern>
<shadedPattern>${ratis.thirdparty.shaded.prefix}.com.google.logging.type</shadedPattern>
</relocation>
<relocation>
<pattern>com.google.longrunning</pattern>
<shadedPattern>${ratis.thirdparty.shaded.prefix}.com.google.longrunning</shadedPattern>
</relocation>
<relocation>
<pattern>com.google.protobuf</pattern>
<shadedPattern>${ratis.thirdparty.shaded.prefix}.com.google.protobuf</shadedPattern>
</relocation>
<relocation>
<pattern>com.google.rpc</pattern>
<shadedPattern>${ratis.thirdparty.shaded.prefix}.com.google.rpc</shadedPattern>
</relocation>
<relocation>
<pattern>com.google.thirdparty.publicsuffix</pattern>
<shadedPattern>${ratis.thirdparty.shaded.prefix}.com.google.thirdparty.publicsuffix</shadedPattern>
</relocation>
<relocation>
<pattern>com.google.type</pattern>
<shadedPattern>${ratis.thirdparty.shaded.prefix}.com.google.type</shadedPattern>
</relocation>
<relocation>
<pattern>io.grpc</pattern>
<shadedPattern>${ratis.thirdparty.shaded.prefix}.io.grpc</shadedPattern>
</relocation>
<relocation>
<pattern>io.netty</pattern>
<shadedPattern>${ratis.thirdparty.shaded.prefix}.io.netty</shadedPattern>
</relocation>
<relocation>
<pattern>io.opencensus</pattern>
<shadedPattern>${ratis.thirdparty.shaded.prefix}.io.opencensus</shadedPattern>
</relocation>
<relocation>
<pattern>com.google.gson</pattern>
<shadedPattern>${ratis.thirdparty.shaded.prefix}.com.google.gson</shadedPattern>
</relocation>
<relocation>
<pattern>afu</pattern>
<shadedPattern>${ratis.thirdparty.shaded.prefix}.afu</shadedPattern>
</relocation>
<relocation>
<pattern>org.checkerframework</pattern>
<shadedPattern>${ratis.thirdparty.shaded.prefix}.org.checkerframework</shadedPattern>
</relocation>
<relocation>
<pattern>com.codahale.metrics</pattern>
<shadedPattern>${ratis.thirdparty.shaded.prefix}.com.codahale.metrics</shadedPattern>
</relocation>
<relocation>
<pattern>info.ganglia</pattern>
<shadedPattern>${ratis.thirdparty.shaded.prefix}.info.ganglia</shadedPattern>
</relocation>
<relocation>
<pattern>io.perfmark</pattern>
<shadedPattern>${ratis.thirdparty.shaded.prefix}.io.perfmark</shadedPattern>
</relocation>
</relocations>
<filters>
<!-- Filter unshaded netty_tcnative libs -->
<filter>
<artifact>io.netty:netty-tcnative-boringssl-static</artifact>
<excludes>
<exclude>META-INF/native/libnetty_tcnative_linux_aarch_64.so</exclude>
<exclude>META-INF/native/libnetty_tcnative_linux_x86_64.so</exclude>
<exclude>META-INF/native/netty_tcnative_windows_x86_64.dll</exclude>
<exclude>META-INF/native/libnetty_tcnative_osx_aarch_64.jnilib</exclude>
<exclude>META-INF/native/libnetty_tcnative_osx_x86_64.jnilib</exclude>
</excludes>
</filter>
<filter>
<artifact>io.netty:netty-resolver-dns-native-macos</artifact>
<excludes>
<exclude>META-INF/native/libnetty_resolver_dns_native_macos_x86_64.jnilib</exclude>
</excludes>
</filter>
<filter>
<artifact>io.netty:netty-transport-native-epoll</artifact>
<excludes>
<exclude>META-INF/native/libnetty_transport_native_epoll_x86_64.so</exclude>
<exclude>META-INF/native/libnetty_transport_native_epoll_aarch_64.so</exclude>
</excludes>
</filter>
<filter>
<artifact>io.netty:netty-transport-native-kqueue</artifact>
<excludes>
<exclude>META-INF/native/libnetty_transport_native_kqueue_x86_64.jnilib</exclude>
</excludes>
</filter>
</filters>
<artifactSet>
<includes>
<!-- Package all listed dependencies -->
<include>*:*</include>
</includes>
<excludes>
<!-- Remove transitive stuff we don't need coming from google deps -->
<exclude>com.google.code.findbugs:jsr305</exclude>
<exclude>com.google.errorprone:error_prone_annotations</exclude>
<exclude>com.google.j2objc:j2objc-annotations</exclude>
<!-- Transitive stuff we don't need from netty -->
<exclude>io.netty:netty-codec-socks</exclude>
<exclude>io.netty:netty-handler-proxy</exclude>
<!-- Transitive stuff we don't need coming from google deps -->
<exclude>org.codehaus.mojo:animal-sniffer-annotations</exclude>
<exclude>org.slf4j:slf4j-api</exclude>
<exclude>org.acplt:oncrpc</exclude>
<exclude>com.google.api.grpc:proto-google-common-protos</exclude>
</excludes>
</artifactSet>
<!-- Pick up any LICENSE/NOTICE files from our dependencies -->
<transformers>
<!-- There are transformers for LICENSE and NOTICE, but none of our dependencies have proper upstream
L&N files, so we can just manage it ourselves with less pain and more correctness. -->
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
</transformers>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>${maven-dependency-plugin.version}</version>
<executions>
<execution>
<id>unpack-dependencies</id>
<phase>validate</phase>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<includeGroupIds>io.netty</includeGroupIds>
<includeArtifactIds>
netty-resolver-dns-native-macos,
netty-tcnative-boringssl-static,
netty-transport-native-epoll,
netty-transport-native-kqueue
</includeArtifactIds>
<includes>**/META-INF/native/*</includes>
<outputDirectory>${project.build.directory}/classes/</outputDirectory>
<overWriteReleases>true</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
</configuration>
</execution>
</executions>
</plugin>
<!-- The native libraries need to be named in the same way we relocate the Netty classes via the shade-plugin -->
<plugin>
<groupId>com.coderplus.maven.plugins</groupId>
<artifactId>copy-rename-maven-plugin</artifactId>
<version>${copy-rename-maven-plugin.version}</version>
<executions>
<execution>
<id>rename-file</id>
<phase>generate-sources</phase>
<goals>
<goal>rename</goal>
</goals>
<configuration>
<fileSets>
<fileSet>
<sourceFile>${project.build.directory}/classes/META-INF/native/libnetty_resolver_dns_native_macos_x86_64.jnilib</sourceFile>
<destinationFile>${project.build.directory}/classes/META-INF/native/lib${ratis.thirdparty.shaded.native.prefix}netty_resolver_dns_native_macos_x86_64.jnilib</destinationFile>
</fileSet>
<fileSet>
<sourceFile>${project.build.directory}/classes/META-INF/native/libnetty_tcnative_linux_aarch_64.so</sourceFile>
<destinationFile>${project.build.directory}/classes/META-INF/native/lib${ratis.thirdparty.shaded.native.prefix}netty_tcnative_linux_aarch_64.so</destinationFile>
</fileSet>
<fileSet>
<sourceFile>${project.build.directory}/classes/META-INF/native/libnetty_transport_native_epoll_aarch_64.so</sourceFile>
<destinationFile>${project.build.directory}/classes/META-INF/native/lib${ratis.thirdparty.shaded.native.prefix}netty_transport_native_epoll_aarch_64.so</destinationFile>
</fileSet>
<fileSet>
<sourceFile>${project.build.directory}/classes/META-INF/native/libnetty_tcnative_linux_x86_64.so</sourceFile>
<destinationFile>${project.build.directory}/classes/META-INF/native/lib${ratis.thirdparty.shaded.native.prefix}netty_tcnative_linux_x86_64.so</destinationFile>
</fileSet>
<fileSet>
<sourceFile>${project.build.directory}/classes/META-INF/native/netty_tcnative_windows_x86_64.dll</sourceFile>
<destinationFile>${project.build.directory}/classes/META-INF/native/${ratis.thirdparty.shaded.native.prefix}netty_tcnative_windows_x86_64.dll</destinationFile>
</fileSet>
<fileSet>
<sourceFile>${project.build.directory}/classes/META-INF/native/libnetty_tcnative_osx_aarch_64.jnilib</sourceFile>
<destinationFile>${project.build.directory}/classes/META-INF/native/lib${ratis.thirdparty.shaded.native.prefix}netty_tcnative_osx_aarch_64.jnilib</destinationFile>
</fileSet>
<fileSet>
<sourceFile>${project.build.directory}/classes/META-INF/native/libnetty_tcnative_osx_x86_64.jnilib</sourceFile>
<destinationFile>${project.build.directory}/classes/META-INF/native/lib${ratis.thirdparty.shaded.native.prefix}netty_tcnative_osx_x86_64.jnilib</destinationFile>
</fileSet>
<fileSet>
<sourceFile>${project.build.directory}/classes/META-INF/native/libnetty_transport_native_epoll_x86_64.so</sourceFile>
<destinationFile>${project.build.directory}/classes/META-INF/native/lib${ratis.thirdparty.shaded.native.prefix}netty_transport_native_epoll_x86_64.so</destinationFile>
</fileSet>
<fileSet>
<sourceFile>${project.build.directory}/classes/META-INF/native/libnetty_transport_native_kqueue_x86_64.jnilib</sourceFile>
<destinationFile>${project.build.directory}/classes/META-INF/native/lib${ratis.thirdparty.shaded.native.prefix}netty_transport_native_kqueue_x86_64.jnilib</destinationFile>
</fileSet>
</fileSets>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>