【问题标题】:Exception when trying to upgrade to sbt eclipse 4.0.0尝试升级到 sbt eclipse 4.0.0 时出现异常
【发布时间】:2015-09-16 05:29:20
【问题描述】:

我已经成功使用 sbt-eclipse 3.0.0 一段时间了。我最近升级到 Play 2.3.8,需要升级到 sbt-eclipse 4.0.0 以避免this problem。我尝试更新 project/plugins.sbt,但在运行 activator eclipse 时出现此错误:

java.lang.NoSuchMethodError: com.typesafe.sbteclipse.core.EclipsePlugin$.EclipseKeys()Lcom/typesafe/sbteclipse/core/EclipsePlugin$EclipseKeys$;
    at play.PlayEclipse$class.eclipseCommandSettings(PlayEclipse.scala:93)
    at play.Play$.eclipseCommandSettings(Project.scala:17)
    at play.PlayScala$.projectSettings(Project.scala:72)
    at sbt.Load$$anonfun$autoPluginSettings$1$1.apply(Load.scala:666)
    at sbt.Load$$anonfun$autoPluginSettings$1$1.apply(Load.scala:666)
    .....

我尝试只在我的 ~/.sbt/0.13/plugins/plugins.sbt 中引用 4.0.0,然后只在我的 project/plugins.sbt 中引用,但这似乎没有什么区别。事实上,当 both 引用被删除时,我可以运行 3.0.0 activator eclipse。在这种情况下,我不知道 activator/sbt 如何找到 3.0.0 插件 - 也许我的错误是由于同时加载了 3.0.0 和 4.0.0?

环境:

Play 2.3.8
Activator 1.3.4
Scala 2.10.4

~/.sbt/0.13/plugins/plugins.sbt 为空

项目/build.properties:

sbt.version=0.13.8

项目/plugins.sbt:

// Comment to get more information during initialization
logLevel := Level.Info

addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.3.8")

addSbtPlugin("com.typesafe.sbt" % "sbt-uglify" % "1.0.3")

addSbtPlugin("com.typesafe.sbt" % "sbt-digest" % "1.0.0")

addSbtPlugin("com.typesafe.sbt" % "sbt-uglify" % "1.0.3")

addSbtPlugin("com.typesafe.sbt" % "sbt-gzip" % "1.0.0")

addSbtPlugin("com.typesafe.sbt" % "sbt-rjs" % "1.0.6")

addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "4.0.0")

resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"

【问题讨论】:

标签: eclipse playframework-2.3 typesafe-activator sbteclipse


【解决方案1】:

我的解决方案是在全局或项目中删除对 eclipse 的支持,因为 play 已经为生成 eclipse 文件提供了内部支持。 其实sbt-eclipse的4.0.0版本才是问题所在。

【讨论】:

    【解决方案2】:

    从以下位置升级您的播放插件版本:

    addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.3.8")
    

    到:

    addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.4.6")
    

    这将适用于 eclipse 插件 4.0.0

    【讨论】:

      【解决方案3】:

      我删除了以下

      addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "4.0.0")
      

      来自

      ~/.sbt/0.13/plugins/plugins.sbt
      

      project_root/project/plugins.sbt
      

      这对我有帮助。

      【讨论】:

        猜你喜欢
        • 2018-08-08
        • 1970-01-01
        • 2014-06-14
        • 2013-07-22
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多