I think that the best way currently is to add these dependencies:

Import the Netty BOM in the main pom.xml
<dependency>
  <groupId>io.netty</groupId>
  <artifactId>netty-bom</artifactId>
  <version>${netty.version}</version>
  <type>pom</type>
  <scope>import</scope>
</dependency>


declare netty dependencies without setting the version and the classifier
<dependency>
  <groupId>io.netty</groupId>
  <artifactId>netty-tcnative-boringssl-static</artifactId>
</dependency>

This is the way we are doing it in Pulsar
https://github.com/apache/pulsar/blob/d7f355881b2b1eebf2be6ea262c202660d684fb7/pom.xml#L647
https://github.com/apache/pulsar/blob/d7f355881b2b1eebf2be6ea262c202660d684fb7/pulsar-common/pom.xml#L146

This way Maven should bundle all the native libraries for all the
supported platforms



Enrico

Il giorno gio 15 giu 2023 alle ore 12:50 Andor Molnar
<[email protected]> ha scritto:
>
> Hi,
>
> I've come across the following when working on the support of native
> SSL libraries. Currently ZooKeeper supports loading the native epoll-
> based event loop of Netty, but a build profile which would download the
> required dependencies is not shipped with our product.
>
> This is perfectly okay since the feature of using native libraries is
> not a build-time requirement, but in this case the user has to download
> the required and appropriate versions of Netty jars and put them on the
> classpath.
>
> Shall we add a Maven build profile to ease this process?
>
> <profile>
>   <id>netty-native</id>
>   <properties>
>     <os.detection.classifierWithLikes>fedora</os.detection.classifierWi
> thLikes>
>   </properties>
>   <dependencyManagement>
>     <dependencies>
>       <dependency>
>         <groupId>io.netty</groupId>
>         <artifactId>netty-tcnative-boringssl-static</artifactId>
>         <version>${netty-tcnative.version}</version>
>         <classifier>${os.detected.classifier}</classifier>
>       </dependency>
>       <dependency>
>         <groupId>io.netty</groupId>
>         <artifactId>netty-transport-native-epoll</artifactId>
>         <version>${netty.version}</version>
>         <classifier>${os.detected.classifier}</classifier>
>       </dependency>
>     </dependencies>
>   </dependencyManagement>
> </profile>
>
> What do you think?
>
> Andor
>
>
>

Reply via email to