blob: 5d5143751ce4fb940aa1be7d329e3971983ad009 [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>0.5.0</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>
<version>${shaded.protobuf.version}</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-netty</artifactId>
<version>${shaded.grpc.version}</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-protobuf</artifactId>
<version>${shaded.grpc.version}</version>
</dependency>
<dependency>
<groupId>com.google.flatbuffers</groupId>
<artifactId>flatbuffers-java</artifactId>
<version>${shaded.flatbuffers.version}</version>
</dependency>
<dependency>
<groupId>com.google.flatbuffers</groupId>
<artifactId>flatbuffers-java-grpc</artifactId>
<version>${shaded.flatbuffers.version}</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-stub</artifactId>
<version>${shaded.grpc.version}</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-context</artifactId>
<version>${shaded.grpc.version}</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${guava.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>${shaded.netty.version}</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.2</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-tcnative-boringssl-static</artifactId>
</dependency>
<dependency>
<groupId>io.opencensus</groupId>
<artifactId>opencensus-api</artifactId>
<version>${io.opencensus.version}</version>
</dependency>
<dependency>
<groupId>io.opencensus</groupId>
<artifactId>opencensus-contrib-grpc-metrics</artifactId>
<version>${io.opencensus.version}</version>
</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.api</pattern>
<shadedPattern>${ratis.thirdparty.shaded.prefix}.com.google.api</shadedPattern>
</relocation>
<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>com.google.flatbuffers</pattern>
<shadedPattern>${ratis.thirdparty.shaded.prefix}.com.google.flatbuffers</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>
</relocations>
<filters>
<!-- Filter unshaded netty_tcnative libs -->
<filter>
<artifact>io.netty:netty-tcnative-boringssl-static</artifact>
<excludes>
<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_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>
<!-- Specifying netty-all gets all of these -->
<exclude>io.netty:netty-buffer</exclude>
<exclude>io.netty:netty-codec-http2</exclude>
<exclude>io.netty:netty-codec-http</exclude>
<exclude>io.netty:netty-codec-socks</exclude>
<exclude>io.netty:netty-codec</exclude>
<exclude>io.netty:netty-common</exclude>
<exclude>io.netty:netty-handler-proxy</exclude>
<exclude>io.netty:netty-handler</exclude>
<exclude>io.netty:netty-resolver</exclude>
<exclude>io.netty:netty-transport</exclude>
<!-- Transitive stuff we don't need coming from google deps -->
<exclude>org.codehaus.mojo:animal-sniffer-annotations</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>3.0.2</version>
<executions>
<execution>
<id>unpack-dependencies</id>
<phase>validate</phase>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<includeGroupIds>io.netty</includeGroupIds>
<includeArtifactIds>netty-tcnative-boringssl-static</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>1.0</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_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_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>
</fileSets>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>