Skip to content

brotli4j dependency should be marked optional in POM #1584

Description

@altuso

brotli4j is declared as a regular compile-scope dependency in openpdf's POM, but it should be <optional>true</optional> since it is optional and can be toggled on via flag.

For now any project that includes openpdf transitively gets brotli4j on its classpath. Libraries that detect brotli4j at runtime (e.g.pache HttpClient 5 registers a Brotli decompressor when it finds brotli4j) will then try to use it — and fail with UnsatisfiedLinkError because the JNI native library is not bundled.

To reproduce:

Add openpdf 3.0.5 to a project that also uses httpclient5. Any HTTP response will trigger:
java.lang.UnsatisfiedLinkError: 'java.nio.ByteBuffer com.aayushatharva.brotli4j.decoder.DecoderJNI.nativeCreate(long[])'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions