Trying to rename the netty .so
Project: http://git-wip-us.apache.org/repos/asf/hbase-thirdparty/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase-thirdparty/commit/d91f4f0e Tree: http://git-wip-us.apache.org/repos/asf/hbase-thirdparty/tree/d91f4f0e Diff: http://git-wip-us.apache.org/repos/asf/hbase-thirdparty/diff/d91f4f0e Branch: refs/heads/master Commit: d91f4f0e94b3c1c727b2b56cdf3c689f8bd29a07 Parents: c3d0cf9 Author: Michael Stack <st...@apache.org> Authored: Mon Jun 26 20:59:38 2017 -0700 Committer: Michael Stack <st...@apache.org> Committed: Mon Jun 26 20:59:38 2017 -0700 ---------------------------------------------------------------------- hbase-shaded-thirdparty/pom.xml | 140 ++++++++++++++++++++++------------- 1 file changed, 87 insertions(+), 53 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase-thirdparty/blob/d91f4f0e/hbase-shaded-thirdparty/pom.xml ---------------------------------------------------------------------- diff --git a/hbase-shaded-thirdparty/pom.xml b/hbase-shaded-thirdparty/pom.xml index daa3c73..d24b49b 100644 --- a/hbase-shaded-thirdparty/pom.xml +++ b/hbase-shaded-thirdparty/pom.xml @@ -41,64 +41,98 @@ Pulls down libs, relocates them and then makes a fat new jar with them all in it. </description> <build> - <plugins> - <plugin> - <artifactId>maven-clean-plugin</artifactId> - <configuration> - <filesets> - <fileset> - <directory>${basedir}</directory> - <includes> - <include>dependency-reduced-pom.xml</include> - </includes> - </fileset> - </filesets> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-shade-plugin</artifactId> - <executions> - <execution> - <phase>package</phase> - <goals> - <goal>shade</goal> - </goals> - <configuration> - <relocations> - <relocation> - <pattern>io.netty</pattern> - <shadedPattern>${rename.offset}.io.netty</shadedPattern> - <excludes> - <!--Getting at native code; can't relocate this w/o changing c-source + <plugins> + <plugin> + <artifactId>maven-clean-plugin</artifactId> + <configuration> + <filesets> + <fileset> + <directory>${basedir}</directory> + <includes> + <include>dependency-reduced-pom.xml</include> + </includes> + </fileset> + </filesets> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-shade-plugin</artifactId> + <executions> + <execution> + <phase>package</phase> + <goals> + <goal>shade</goal> + </goals> + <configuration> + <relocations> + <relocation> + <pattern>libnetty-transport-native-epoll.so</pattern> + <shadedPattern>lib${rename.offset}-netty-transport-native-epoll.so</shadedPattern> + <excludes> + <!--Getting at native code; can't relocate this w/o changing c-source --> - <exclude> + <exclude> io.netty.channel.unix.* </exclude> - </excludes> - </relocation> - <relocation> - <pattern>com.google</pattern> - <shadedPattern>${rename.offset}.com.google</shadedPattern> - </relocation> - </relocations> - <artifactSet> - <excludes> - <!--Exclude protobuf itself. We get a patched version in adjacent module. + </excludes> + </relocation> + <relocation> + <pattern>io.netty</pattern> + <shadedPattern>${rename.offset}.io.netty</shadedPattern> + </relocation> + <relocation> + <pattern>com.google</pattern> + <shadedPattern>${rename.offset}.com.google</shadedPattern> + </relocation> + </relocations> + <artifactSet> + <excludes> + <!--Exclude protobuf itself. We get a patched version in adjacent module. Exclude other dependencies of guava, netty, etc. --> - <exclude>com.google.protobuf:protobuf-java</exclude> - <exclude>com.google.code.findbugs:jsr305</exclude> - <exclude>com.google.errorprone:error_prone_annotations</exclude> - <exclude>com.google.j2objc:j2objc-annotations</exclude> - <exclude>org.codehaus.mojo:animal-sniffer-annotations</exclude> - <exclude>org.codehaus.mojo:animal-sniffer-annotations</exclude> - </excludes> - </artifactSet> - </configuration> - </execution> - </executions> - </plugin> + <exclude>com.google.protobuf:protobuf-java</exclude> + <exclude>com.google.code.findbugs:jsr305</exclude> + <exclude>com.google.errorprone:error_prone_annotations</exclude> + <exclude>com.google.j2objc:j2objc-annotations</exclude> + <exclude>org.codehaus.mojo:animal-sniffer-annotations</exclude> + <exclude>org.codehaus.mojo:animal-sniffer-annotations</exclude> + </excludes> + </artifactSet> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <!--This trick from + https://stackoverflow.com/questions/33825743/rename-files-inside-a-jar-using-some-maven-plugin + --> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-antrun-plugin</artifactId> + <version>1.8</version> + <executions> + <execution> + <id>unpack</id> + <phase>package</phase> + <configuration> + <target> + <echo message="unjar"/> + <unzip src="${project.build.directory}/${artifactId}-${version}.jar" + dest="${project.build.directory}/unpacked/"/> + <echo message="Rename netty .so in META-INF"/> + <move file="${project.build.directory}/unpacked/META-INF/native/libnetty-transport-native-epoll.so" + tofile="${project.build.directory}/unpacked/META-INF/native/lib${rename.offset}netty-transport-native-epoll.so" /> + <echo message="Redo jar"/> + <jar destfile="${project.build.directory}/${artifactId}-${version}.jar" + basedir="${project.build.directory}/unpacked"/> + </target> + </configuration> + <goals> + <goal>run</goal> + </goals> + </execution> + </executions> + </plugin> </plugins> </build> <dependencies>