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

ShadowJar support (for auto gathering relocations) possibly being removed #16

Open
Vankka opened this issue May 11, 2023 · 0 comments
Open

Comments

@Vankka
Copy link
Owner

Vankka commented May 11, 2023

Support for taking relocations directly from shadowJar into the dependency files generated by the Gradle plugin (via the includeShadowJarRelocations option) might be removed in the future.

Doing it requires doing reflection to access the relocations, is unreliable and only seems to be becoming more unreliable in the most recent Gradle versions.

The recommended replacement is doing something like this:

[
    'org.apache.commons',
    'com.google.gson'
].each {
    var relocated = 'com.example.myapp.dependencies.' + it
    tasks.shadowJar.relocate it, relocated
    tasks.generateRuntimeDownloadResourceForRuntimeDownloadOnly.relocate it, relocated
}
@Vankka Vankka pinned this issue May 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant