【问题标题】:Error while importing sbt project: idea导入 sbt 项目时出错:idea
【发布时间】:2015-07-09 02:40:04
【问题描述】:

已经两天了,这个噩梦还在继续。我是 Play 新手。

我可以创建我的游戏项目,编译它并使用命令运行。

但是当我尝试使用 Intellij Idea 导入或打开它时,我收到以下错误。

我不能像here 中提到的那样从命令行执行activator idea。当我这样做时,我明白了。

我昨天能够完成导入工作,但由于 build.propertiesplugins.sbt 文件中的一些更改而停止。现在,当我创建一个新文件时,文件看起来像这样。

plugin.sbt

// The Play plugin
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.4.2")

// Web plugins
addSbtPlugin("com.typesafe.sbt" % "sbt-coffeescript" % "1.0.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-less" % "1.0.6")
addSbtPlugin("com.typesafe.sbt" % "sbt-jshint" % "1.0.3")
addSbtPlugin("com.typesafe.sbt" % "sbt-rjs" % "1.0.7")
addSbtPlugin("com.typesafe.sbt" % "sbt-digest" % "1.1.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-mocha" % "1.1.0")

// Play enhancer - this automatically generates getters/setters for public fields
// and rewrites accessors of these fields to use the getters/setters. Remove this
// plugin if you prefer not to have this feature, or disable on a per project
// basis using disablePlugins(PlayEnhancer) in your build.sbt
//addSbtPlugin("com.typesafe.sbt" % "sbt-play-enhancer" % "1.1.0")

// Play Ebean support, to enable, uncomment this line, and enable in your build.sbt using
// enablePlugins(SbtEbean). Note, uncommenting this line will automatically bring in
// Play enhancer, regardless of whether the line above is commented out or not.
// addSbtPlugin("com.typesafe.sbt" % "sbt-play-ebean" % "1.0.0")

build.properties

#Activator-generated Properties
#Thu Jul 09 08:03:01 NPT 2015
template.uuid=4908845b-9453-410b-af0f-404c1440dff1
sbt.version=0.13.8

然后项目以某种方式崩溃了。现在我无法导入项目。

我感觉问题出在 IDE 方面。

【问题讨论】:

  • 您使用的是哪个版本的 IntelliJ?我发现对 Scala/SBT 的支持在 14 岁以上得到了显着改善。
  • @MansoorSiddiqui 14.1.3 版本
  • 您能提供来自~/.IntelliJIdea14/system/log/sbt.last.log 的完整堆栈跟踪吗? activator idea对于 play 2.4 项目来说不是必需的,因此该命令不再存在。

标签: java intellij-idea playframework playframework-2.4


【解决方案1】:

正如上面 Alexander 的评论中提到的,实际答案将在 idea.log 中给出 - IntelliJ 错误对话框还有很多不足之处。

来自migration guide

Play 不再包含 sbteclipse 或 sbt-idea 插件,这使用户能够独立于 Play 升级 IDE 支持。

IntelliJ 现在可以本地导入 sbt 项目,因此我们建议改用它。或者,sbt-idea插件也可以手动安装使用,使用说明见here

你可以按照迁移指南中的link,将idea插件重新添加到sbt中。

但是,通常情况下,您应该能够完全按照您正在做的事情进行。

  1. 如果您还没有安装 Scala 插件 - 这不仅支持 Scala,还支持 Play 和 sbt
  2. “文件”>“打开”>选择build.sbt
  3. 项目将导入 IntelliJ

【讨论】:

    猜你喜欢
    • 2019-02-12
    • 2018-04-20
    • 1970-01-01
    • 2014-09-16
    • 2017-05-06
    • 2021-09-10
    • 2020-01-28
    • 1970-01-01
    • 2016-08-10
    相关资源
    最近更新 更多