You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I added gradle-jaxb-plugin to my project and the build started failing with:
Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.google.inject.internal.Annotations
at com.google.inject.Key.ensureRetainedAtRuntime(Key.java:362)
at com.google.inject.Key.strategyFor(Key.java:339)
at com.google.inject.Key.get(Key.java:274)
at com.google.inject.assistedinject.FactoryModuleBuilder.implement(FactoryModuleBuilder.java:266)
at com.google.inject.assistedinject.FactoryModuleBuilder.implement(FactoryModuleBuilder.java:250)
at com.google.inject.assistedinject.FactoryModuleBuilder.implement(FactoryModuleBuilder.java:242)
at com.google.inject.assistedinject.FactoryModuleBuilder$implement.call(Unknown Source)
at org.openrepose.gradle.plugins.jaxb.schema.guice.DocSlurperModule.configure(DocSlurperModule.groovy:44)
at com.google.inject.AbstractModule.configure(AbstractModule.java:62)
at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:229)
at com.google.inject.spi.Elements.getElements(Elements.java:103)
at com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:136)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:104)
at com.google.inject.Guice.createInjector(Guice.java:94)
at com.google.inject.Guice.createInjector(Guice.java:71)
at com.google.inject.Guice$createInjector.call(Unknown Source)
at org.openrepose.gradle.plugins.jaxb.JaxbPlugin.apply(JaxbPlugin.groovy:51)
at org.openrepose.gradle.plugins.jaxb.JaxbPlugin.apply(JaxbPlugin.groovy)
The issue seems to be with the Guice library that is used by gradle-jaxb-plugin and ends up being pulled transitively into Gradle classpath (Gradle does not have separate classloaders for separate plugins).
Judging by the stack trace, it is in conflict with Sonatype sisu-guice-3.1.0 library which probably comes from some Maven plugin (as Sonatype is the company behind Maven).
Solution: shadow the Guice library, pull it into gradle-jaxb-plugin namespace.
The text was updated successfully, but these errors were encountered:
nemecec
pushed a commit
to sympower/gradle-jaxb-plugin
that referenced
this issue
Dec 17, 2019
I added
gradle-jaxb-plugin
to my project and the build started failing with:The issue seems to be with the Guice library that is used by
gradle-jaxb-plugin
and ends up being pulled transitively into Gradle classpath (Gradle does not have separate classloaders for separate plugins).Judging by the stack trace, it is in conflict with Sonatype
sisu-guice-3.1.0
library which probably comes from some Maven plugin (as Sonatype is the company behind Maven).Solution: shadow the Guice library, pull it into
gradle-jaxb-plugin
namespace.The text was updated successfully, but these errors were encountered: