Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manually relocate snakeyaml multi-release classes. #1008

Merged
merged 2 commits into from
Nov 6, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,13 @@
<pattern>org.yaml.snakeyaml</pattern>
<shadedPattern>net.datafaker.shaded.snakeyaml</shadedPattern>
</relocation>
<!-- Manually relocate shaded snakeyaml multi-release classes to the correct package. This is
needed due to a bug in the Maven Shade plugin, which only relocates the content but not
the package structure itself, see https://issues.apache.org/jira/browse/MSHADE-406. -->
<relocation>
<pattern>META-INF/versions/9/org.yaml.snakeyaml</pattern>
<shadedPattern>META-INF/versions/9/net.datafaker.shaded.snakeyaml</shadedPattern>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious whether there is a more generic solution which could handle other versions once they appear...
Otherwise any new version will lead to the same issue

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There might be an (undocumented way) to do this, I am currently looking at the Maven plugin code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The follwing commit should address your concern. Now all versions of the org.yaml.snakeyaml package are being relocated. Although new versions will not come around very often and I hope that the actual bug in the Maven plugin will get fixed sooner or later so that this workaround can be removed.

</relocation>
<relocation>
<pattern>com.mifmif.common.regex</pattern>
<shadedPattern>net.datafaker.shaded.generex</shadedPattern>
Expand Down