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

Paperweight-userdev setup fails in multi-module project with kotlinx.serialization plugin #260

Closed
NichtStudioCode opened this issue Nov 3, 2024 · 2 comments

Comments

@NichtStudioCode
Copy link

NichtStudioCode commented Nov 3, 2024

The setup of the paperweight-userdev plugin fails with the following exception in multi-module projects, when one module uses the kotlinx.serialization plugin and another one doesn't (and both use paperweight-userdev). This does not happen when all modules use the plugin, as far as I can see kotlinx.serialization causes some sort of "class path isolation" between the different modules at build time.

Caused by: java.lang.ClassCastException: class io.papermc.paperweight.userdev.internal.setup.UserdevSetup$Inject cannot be cast to class io.papermc.paperweight.userdev.internal.setup.UserdevSetup (io.papermc.paperweight.userdev.internal.setup.UserdevSetup$Inject is in unnamed module of loader org.gradle.internal.classloader.VisitableURLClassLoader$InstrumentingVisitableURLClassLoader @61ecac73; io.papermc.paperweight.userdev.internal.setup.UserdevSetup is in unnamed module of loader org.gradle.internal.classloader.VisitableURLClassLoader$InstrumentingVisitableURLClassLoader @1d3c8c88)
	at io.papermc.paperweight.userdev.PaperweightUser.createSetup(PaperweightUser.kt:321)
	at io.papermc.paperweight.userdev.PaperweightUser.access$createSetup(PaperweightUser.kt:57)
	at io.papermc.paperweight.userdev.PaperweightUser$apply$userdevSetup$2.invoke(PaperweightUser.kt:87)
	at io.papermc.paperweight.userdev.PaperweightUser$apply$userdevSetup$2.invoke(PaperweightUser.kt:87)
	at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
	at io.papermc.paperweight.userdev.PaperweightUser.apply$lambda$1(PaperweightUser.kt:87)
	at io.papermc.paperweight.userdev.PaperweightUser.access$apply$lambda$1(PaperweightUser.kt:57)
	at io.papermc.paperweight.userdev.PaperweightUser$apply$4.execute(PaperweightUser.kt:166)
	at io.papermc.paperweight.userdev.PaperweightUser$apply$4.execute(PaperweightUser.kt:134)
	at org.gradle.internal.code.DefaultUserCodeApplicationContext$CurrentApplication$1.execute(DefaultUserCodeApplicationContext.java:123)
(... and more gradle-internal lines)

I have created a sample repository to reproduce this issue: NichtStudioCode/paperweight-userdev-kotlinx-serialization-conflict.

@lynxplay
Copy link
Contributor

lynxplay commented Nov 3, 2024

Presumably just a duplicate of #161 ?

@NichtStudioCode
Copy link
Author

yep, my bad

@NichtStudioCode NichtStudioCode closed this as not planned Won't fix, can't repro, duplicate, stale Nov 3, 2024
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