导入sbt项目时出现错误:idea

3

已经过去两天了,这场噩梦仍在继续。我是Play的新手。

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

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

enter image description here

我也无法像这里提到的那样通过命令行执行激活器想法。当我尝试时,会得到以下结果。

enter image description here

昨天我能够完成导入工作,这是由于 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?我发现14+版本中对Scala/SBT的支持显著提高了。 - Mansoor Siddiqui
@MansoorSiddiqui 14.1.3 版本 - Nabin
1
你能提供 ~/.IntelliJIdea14/system/log/sbt.last.log 中的完整堆栈跟踪吗? 对于Play 2.4项目,activator idea不再必要,因此该命令已不存在。 - Alexander B
1个回答

0

如Alexander在上面的评论中提到的那样,实际答案将在idea.log中给出 - IntelliJ错误对话框还有很多需要改进的地方。

迁移指南

Play不再包括sbteclipse或sbt-idea插件,这使得用户可以独立升级IDE支持。

现在,IntelliJ能够原生地导入sbt项目,因此我们建议使用它。或者,可以手动安装并使用sbt-idea插件,说明可以在这里找到。

您可以按照迁移指南中的链接,将idea插件添加回sbt中。

但是,通常情况下,您应该能够做到与您之前所做的完全相同。

  1. 如果您还没有安装Scala插件,请先安装 - 这将为Scala、Play和sbt提供支持
  2. "文件" > "打开" > 选择 build.sbt
  3. 项目将被导入到IntelliJ中

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接