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

Plugin dependencies are not relocated properly #140

Open
invisicat opened this issue Jul 7, 2022 · 1 comment
Open

Plugin dependencies are not relocated properly #140

invisicat opened this issue Jul 7, 2022 · 1 comment

Comments

@invisicat
Copy link

Describe the issue
The plugin dependencies are not relocated properly. I am currently running into issues where my plugin is trying to load my own shaded dependencies as it throws Linkage errors.

Spigot version
1.18.2 - 1.19.x

Plugin version
2.9.0 (also happens in 2.8.0)

How to reproduce
Create a plugin that uses spigot's library downloader with Lettuce version 6.1.8-RELEASE and reference a lettuce (redis lib) class. Now create another plugin that depends on that plugin and try to access their APIs. You will a similar error as this:

java.lang.LinkageError: loader constraint violation: loader 'thebridge-1.0-SNAPSHOT-remapped.jar' @2b8fb229 
    wants to load interface io.lettuce.core.api.sync.RedisCommands. A different interface with the same name was 
    previously loaded by java.net.URLClassLoader @66aef183. (io.lettuce.core.api.sync.RedisCommands is in unnamed module 
    of loader java.net.URLClassLoader @66aef183, parent loader java.net.URLClassLoader @5702b3b1)

This is quite an issue as I've upgraded to the latest lettuce version and I am now experiencing these issues. 😅

Crash reports (if available)
A plausible solution to this is to relocate the dependencies.

@Paul19988
Copy link
Owner

Yeah that's not the solution we'll take, it's the lack of relocation done for lettuce, I'll relocate it correctly.

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

2 participants