Skip to content

docker-java-transport-zerodep fails to relocate org/publicsuffix/list/effective_tld_names.dat #2625

Open

Description

@JKomoroski

Problem

docker-java-transport-zerodep shades httpclient5 internally, relocating its classes from org.apache.* to com.github.dockerjava.zerodep.shaded.org.apache.*. However, the org/publicsuffix/list/effective_tld_names.dat resource bundled by httpclient5 is not relocated — it remains at its original path inside zerodep's jar.

When a project depends on both docker-java-transport-zerodep and httpclient5 directly (e.g. via WireMock, Spring's RestClient, etc.), two copies of effective_tld_names.dat land on the classpath at the same path. Maven's duplicate-finder-maven-plugin fails the build. This failure is normally not a problem, but it can become one.

Since, PublicSuffixMatcherLoader (already shaded to com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.psl.PublicSuffixMatcherLoader) contains the hardcoded absolute resource path /org/publicsuffix/list/effective_tld_names.dat in its bytecode, it was not updated by the shade plugin's string relocation because the path uses slash notation with a leading /, not dot notation.

Fix

Add two relocation entries to the shade plugin config in docker-java-transport-zerodep/pom.xml:

<!-- Relocates the resource file itself -->
<relocation>
    <pattern>org.publicsuffix</pattern>
    <shadedPattern>com.github.dockerjava.zerodep.shaded.org.publicsuffix</shadedPattern>
</relocation>
<!-- Fixes the absolute-path string literal in PublicSuffixMatcherLoader bytecode -->
<relocation>
    <rawString>true</rawString>
    <pattern>/org/publicsuffix</pattern>
    <shadedPattern>/com/github/dockerjava/zerodep/shaded/org/publicsuffix</shadedPattern>
</relocation>

This moves the dat file to com/github/dockerjava/zerodep/shaded/org/publicsuffix/list/effective_tld_names.dat inside the jar and updates the getResource() call in the shaded bytecode to match — zerodep remains fully self-contained.

Activity

  1. JKomoroski commented on May 12, 2026

    @JKomoroski
    Author

    My testing for this change within my own projects was successful (I use it by way of test-containers). . This should be a low risk change, but I don't have a deep understanding of how the zerodep jar is used across the ecosystem.

  2. JKomoroski commented on May 20, 2026

    @JKomoroski
    Author

    I was able to verify that the shaded version of PublicSuffixMatcherLoader at com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.psl.PublicSuffixMatcherLoader has the correctly updated PUBLIC_SUFFIX_LIST:

        private static final String PUBLIC_SUFFIX_LIST = "/com/github/dockerjava/zerodep/shaded/org/publicsuffix/list/effective_tld_names.dat";
    
  3. bedaka commented on Jun 2, 2026

    @bedaka

    We're also affected by this, would be great to fix it.

  4. JKomoroski commented on Jun 2, 2026

    @JKomoroski
    Author

    We're also affected by this, would be great to fix it.

    Can you test my branch to confirm it is a fix for your use case?

  5. JKomoroski commented on Jun 12, 2026

    @JKomoroski
    Author

    @eddumelendez Sorry to ping you directly, but I'm not sure if this issue and associated PR have caught the attention of docker-java maintainers or if it was lost in the noise.

  6. antonmos commented on Sep 4, 2026

    @antonmos

    following up!

  7. JKomoroski commented on Sep 25, 2026

    @JKomoroski
    Author

    Anyone have any idea on if this is monitored?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions