我看过几篇文章(例如GRAILS-11503 JIRA - scroll to the bottom)表明Grails使用自己版本的Google Guice - 一个难以捉摸的" 3.1.0"版本
然而:
grails dependency-report
时,我看不到" guice"发生在输出中的任何地方所以我问: Grails有自己的Guice版本是真的吗?如果是这样,它在哪里发布,为什么我在运行grails dependency-report
时没有看到它?
我问,因为GRAILS-11503中发布了解决方案(将exclude
子句添加到依赖项中,因此排除了Guice的依赖关系版本,以免与Grails'版本冲突)工作在我的Grails 2.3.6应用程序上。但是现在我升级到2.4.4 突然修复不再有效,我在运行grailsw publish-plugin
时遇到奇怪的Guice异常:
java.lang.IllegalAccessError: tried to access class com.google.inject.internal.UntargettedBindingProcessor$1 from class com.google.inject.internal.UntargettedBindingProcessor
at com.google.inject.internal.UntargettedBindingProcessor.visit(UntargettedBindingProcessor.java:35)
at com.google.inject.internal.UntargettedBindingProcessor.visit(UntargettedBindingProcessor.java:27)
at com.google.inject.internal.BindingImpl.acceptVisitor(BindingImpl.java:93)
at com.google.inject.internal.AbstractProcessor.process(AbstractProcessor.java:56)
at com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:184)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:104)
...huge stack trace omitted for brevity
at gant.Gant.executeTargets(Gant.groovy:591)
at gant.Gant.executeTargets(Gant.groovy:590)
at org.grails.wrapper.GrailsWrapper.main(GrailsWrapper.java:93)
答案 0 :(得分:3)
我没有使用Grails或Maven,但我从官方主页下载了最新的Grails二进制文件(2.4.4):https://grails.org/download.html
在该档案中,有/lib/org.sonatype.sisu/sisu-guice/jars/sisu-guice-3.1.0-{...}.jar
看起来你可以通过以下代码通过Maven链接到达那里:
http://mvnrepository.com/artifact/org.grails/grails-aether/2.4.4
http://mvnrepository.com/artifact/org.eclipse.aether/aether-impl/1.0.0.v20140518
http://mvnrepository.com/artifact/org.sonatype.sisu/sisu-guice