Skip to content

Commit

Permalink
[improve][misc] Replace rename-netty-native-libs.sh script with renam…
Browse files Browse the repository at this point in the history
…ing with maven-shade-plugin (apache#22957)

(cherry picked from commit f728b2e)
(cherry picked from commit 68d92fe)
  • Loading branch information
lhotari authored and srinath-ctds committed Jul 1, 2024
1 parent c4ab0b8 commit 0f4c208
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 252 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,6 @@ components in the Pulsar ecosystem, including connectors, adapters, and other la
>
> This project includes a [Maven Wrapper](https://maven.apache.org/wrapper/) that can be used instead of a system-installed Maven.
> Use it by replacing `mvn` by `./mvnw` on Linux and `mvnw.cmd` on Windows in the commands below.
>
> It's better to use CMD rather than Powershell on Windows. Because maven will activate the `windows` profile which runs `rename-netty-native-libs.cmd`.
### Build

Expand Down
7 changes: 0 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -309,9 +309,6 @@ flexible messaging model and an intuitive client API.</description>
<roaringbitmap.version>1.1.0</roaringbitmap.version>
<extra-enforcer-rules.version>1.6.1</extra-enforcer-rules.version>
<oshi.version>6.4.0</oshi.version>

<!-- Used to configure rename.netty.native. Libs -->
<rename.netty.native.libs>rename-netty-native-libs.sh</rename.netty.native.libs>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -2260,10 +2257,6 @@ flexible messaging model and an intuitive client API.</description>
<family>Windows</family>
</os>
</activation>
<properties>
<rename.netty.native.libs>rename-netty-native-libs.cmd</rename.netty.native.libs>
</properties>

</profile>
<!-- Primary Module profile -->
<profile>
Expand Down
31 changes: 6 additions & 25 deletions pulsar-client-admin-shaded/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,12 @@
<pattern>org.apache.bookkeeper</pattern>
<shadedPattern>org.apache.pulsar.shade.org.apache.bookkeeper</shadedPattern>
</relocation>
<!-- Rename Netty native libraries to include the shaded prefix -->
<relocation>
<pattern>(META-INF/native/(lib)?)(netty.+\.(so|jnilib|dll))$</pattern>
<shadedPattern>$1org_apache_pulsar_shade_$3</shadedPattern>
<rawString>true</rawString>
</relocation>
</relocations>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
Expand All @@ -304,31 +310,6 @@
</execution>
</executions>
</plugin>

<plugin>
<!-- This plugin is used to run a script after the package phase in order to rename
libnetty_transport_native_epoll_x86_64.so from Netty into
liborg_apache_pulsar_shade_netty_transport_native_epoll_x86_64.so
to reflect the shade that is being applied.
-->
<artifactId>exec-maven-plugin</artifactId>
<groupId>org.codehaus.mojo</groupId>
<executions>
<execution>
<id>rename-epoll-library</id>
<phase>package</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>${project.parent.basedir}/src/${rename.netty.native.libs}</executable>
<arguments>
<argument>${project.artifactId}</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
31 changes: 6 additions & 25 deletions pulsar-client-all/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,12 @@
<pattern>org.tukaani</pattern>
<shadedPattern>org.apache.pulsar.shade.org.tukaani</shadedPattern>
</relocation>
<!-- Rename Netty native libraries to include the shaded prefix -->
<relocation>
<pattern>(META-INF/native/(lib)?)(netty.+\.(so|jnilib|dll))$</pattern>
<shadedPattern>$1org_apache_pulsar_shade_$3</shadedPattern>
<rawString>true</rawString>
</relocation>
</relocations>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
Expand All @@ -396,31 +402,6 @@
</execution>
</executions>
</plugin>

<plugin>
<!-- This plugin is used to run a script after the package phase in order to rename
libnetty_transport_native_epoll_x86_64.so from Netty into
liborg_apache_pulsar_shade_netty_transport_native_epoll_x86_64.so
to reflect the shade that is being applied.
-->
<artifactId>exec-maven-plugin</artifactId>
<groupId>org.codehaus.mojo</groupId>
<executions>
<execution>
<id>rename-epoll-library</id>
<phase>package</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>${project.parent.basedir}/src/${rename.netty.native.libs}</executable>
<arguments>
<argument>${project.artifactId}</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
Expand Down
31 changes: 6 additions & 25 deletions pulsar-client-shaded/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,12 @@
<pattern>org.apache.bookkeeper</pattern>
<shadedPattern>org.apache.pulsar.shade.org.apache.bookkeeper</shadedPattern>
</relocation>
<!-- Rename Netty native libraries to include the shaded prefix -->
<relocation>
<pattern>(META-INF/native/(lib)?)(netty.+\.(so|jnilib|dll))$</pattern>
<shadedPattern>$1org_apache_pulsar_shade_$3</shadedPattern>
<rawString>true</rawString>
</relocation>
</relocations>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
Expand All @@ -323,31 +329,6 @@
</execution>
</executions>
</plugin>

<plugin>
<!-- This plugin is used to run a script after the package phase in order to rename
libnetty_transport_native_epoll_x86_64.so from Netty into
liborg_apache_pulsar_shade_netty_transport_native_epoll_x86_64.so
to reflect the shade that is being applied.
-->
<artifactId>exec-maven-plugin</artifactId>
<groupId>org.codehaus.mojo</groupId>
<executions>
<execution>
<id>rename-epoll-library</id>
<phase>package</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>${project.parent.basedir}/src/${rename.netty.native.libs}</executable>
<arguments>
<argument>${project.artifactId}</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
98 changes: 0 additions & 98 deletions src/rename-netty-native-libs.cmd

This file was deleted.

70 changes: 0 additions & 70 deletions src/rename-netty-native-libs.sh

This file was deleted.

0 comments on commit 0f4c208

Please sign in to comment.