You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Niels Basjes (Jira)" <ji...@apache.org> on 2023/03/09 12:16:00 UTC

[jira] [Updated] (MSHADE-439) Relocate does not relocate the other JVM variants in Multi Release jar.

     [ https://issues.apache.org/jira/browse/MSHADE-439?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Niels Basjes updated MSHADE-439:
--------------------------------
    Attachment: pom.xml

> Relocate does not relocate the other JVM variants in Multi Release jar.
> -----------------------------------------------------------------------
>
>                 Key: MSHADE-439
>                 URL: https://issues.apache.org/jira/browse/MSHADE-439
>             Project: Maven Shade Plugin
>          Issue Type: Bug
>    Affects Versions: 3.4.1
>            Reporter: Niels Basjes
>            Priority: Major
>         Attachments: pom.xml
>
>
> The 2.0 release of snakeyaml is a _Multi Release jar (See this [commit|https://bitbucket.org/snakeyaml/snakeyaml/commits/b33f0ca7507fd61fc945722b5d14de4b0aff5262])_.
> For 2 class files they actually package a *standard* and a *java 9* variant of the same thing.
> {code:java}
> $ unzip -l ~/.m2/repository/org/yaml/snakeyaml/2.0/snakeyaml-2.0.jar | fgrep Logger
>      1545  2023-02-26 11:06   META-INF/versions/9/org/yaml/snakeyaml/internal/Logger$Level.class
>      1365  2023-02-26 11:06   META-INF/versions/9/org/yaml/snakeyaml/internal/Logger.class
>      1446  2023-02-26 11:06   org/yaml/snakeyaml/internal/Logger$Level.class
>      1264  2023-02-26 11:06   org/yaml/snakeyaml/internal/Logger.class
> {code}
> When I use the maven-shade-plugin 3.4.1 (latest at the time of writing) to shade this dependency in my project and relocate (!) it to a different package the final jar contains this:
> {code:java}
>      1678  2023-02-26 11:06   META-INF/versions/9/org/yaml/snakeyaml/internal/Logger$Level.class
>      1484  2023-02-26 11:06   META-INF/versions/9/org/yaml/snakeyaml/internal/Logger.class
>      1579  2023-02-26 11:06   nl/basjes/shaded/org/yaml/snakeyaml/internal/Logger$Level.class
>      1383  2023-02-26 11:06   nl/basjes/shaded/org/yaml/snakeyaml/internal/Logger.class
> {code}
> Note that the *standard* variants have been shaded correctly and the *java 9* variants have not been relocated at all.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)