Skip to content

[BUG] Native macOS libraries (osx-aarch64 and osx-x86_64) missing from v1.21.0 JARs on Maven Central #246

@pvillard31

Description

@pvillard31

Summary

The native-osx-aarch64 and native-osx-x86_64 artifacts published to Maven Central for v1.21.0 are missing the native libbrotli.dylib files. This causes an UnsatisfiedLinkError at runtime on macOS.

Steps to Reproduce

  1. Upgrade from Brotli4j 1.20.0 to 1.21.0
  2. Attempt to use Brotli compression/decompression on macOS (both x86_64 and aarch64)

Error

java.lang.UnsatisfiedLinkError: Failed to load Brotli native library Caused by: java.lang.UnsatisfiedLinkError: Failed to find Brotli native library in classpath: /lib/osx-aarch64/libbrotli.dylib

Analysis

I downloaded and inspected the published JARs from Maven Central. The macOS native libraries are missing from v1.21.0 while they were present in v1.20.0:

Artifact v1.20.0 v1.21.0
native-linux-x86_64 libbrotli.so present libbrotli.so present
native-linux-aarch64 libbrotli.so present libbrotli.so present
native-osx-x86_64 libbrotli.dylib present missing
native-osx-aarch64 libbrotli.dylib present missing
native-windows-x86_64 brotli.dll present brotli.dll present
native-windows-aarch64 brotli.dll present brotli.dll present

For example, listing the contents of native-osx-aarch64-1.21.0.jar shows no lib/ directory at all:

META-INF/ META-INF/MANIFEST.MF com/aayushatharva/brotli4j/macos/aarch64/NativeLoader.class META-INF/maven/com.aayushatharva.brotli4j/native-osx-aarch64/pom.xml META-INF/maven/com.aayushatharva.brotli4j/native-osx-aarch64/pom.properties META-INF/versions/9/module-info.class

Whereas native-osx-aarch64-1.20.0.jar correctly contains:

lib/osx-aarch64/libbrotli.dylib

Suspected Cause

The release CI pipeline was restructured in v1.21.0 (#228, #245). The previous approach merged all platform build artifacts into a single directory and deployed from there. The new approach copies individual target/ directories back into the checkout and deploys from the repo root. The macOS artifact copy step may have failed silently — likely because macos-latest now runs on Apple Silicon (aarch64), which may affect where the native build output ends up relative to what the release job expects to copy.

Environment

  • Brotli4j version: 1.21.0
  • Platform: macOS (both aarch64 and x86_64 affected)
  • JDK: 21 (Zulu)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions