Java Guice、PlayFramework 2.4和SbtPlugin的怪异行为

Java Guice、PlayFramework 2.4和SbtPlugin的怪异行为,java,sbt,guice,sbt-plugin,playframework-2.4,Java,Sbt,Guice,Sbt Plugin,Playframework 2.4,我有以下情况: -rootFolder -core -> project with some java files -plugin -> sbt plugin that depends on the core project -sample -> sample project that uses the plugin. 我想制作一个插件,将sbt任务添加到游戏控制台。此任务创建一个GuiceApplicationBuilder,加载一些核心类,然后

我有以下情况:

-rootFolder
   -core    -> project with some java files
   -plugin  -> sbt plugin that depends on the core project
   -sample  -> sample project that uses the plugin.
我想制作一个插件,将sbt任务添加到游戏控制台。此任务创建一个GuiceApplicationBuilder,加载一些核心类,然后停止。类似于上面的代码:

import play.api.inject.guice.GuiceApplicationBuilder
import core.SomeFile

val app = new GuiceApplicationBuilder()
  .in(new File("."))
  .in(myClassloader.value)
  .build

val someFile = app.injector.instanceOf(classOf[SomeFile])
println(someFile.outputSomething)

app.stop
如果我使用sbt方法
dependsOn
一切正常。如果在核心项目中使用
publishLocal
命令,则会出现
java.lang.IllegalAccessError

使用
dependsOn
方法:

build.sbt (plugin project)

lazy val root = project.in(file(".")).dependsOn(core)
lazy val core = file("../core").getAbsoluteFile.toURI

----------------------------------------

plugins.sbt (sample project)

lazy val root = project.in(file(".")).dependsOn(plugin)
lazy val plugin = file("../plugin").getAbsoluteFile.toURI
使用
publishLocal
命令(这是我需要做的,但我做不到):

如果使用
libraryDependencies
addSbtPlugin
,则会引发错误:

[error] (compile:myTask) java.lang.IllegalAccessError: tried to access method com.google.common.collect.MapMaker.makeComputingMap(Lcom/google/common/base/Function;)Ljava/util/concurrent/ConcurrentMap; from class com.google.inject.internal.FailableCache
Github链接以重现问题:

我认为这是一些guice或guava依赖冲突问题…可能是一个bug,我不知道

[error] (compile:myTask) java.lang.IllegalAccessError: tried to access method com.google.common.collect.MapMaker.makeComputingMap(Lcom/google/common/base/Function;)Ljava/util/concurrent/ConcurrentMap; from class com.google.inject.internal.FailableCache