java - 导入sbt项目时出错: idea

标签 java intellij-idea playframework playframework-2.4

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

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

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

enter image description here

我无法从命令行执行activator idea,如上所述 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 端。

最佳答案

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

来自migration guide

Play no longer includes the sbteclipse or sbt-idea plugins, which enables users to upgrade IDE support independently of Play.

IntelliJ is now able to import sbt projects natively, so we recommend using that instead. Alternatively, the sbt-idea plugin can be manually installed and used, instructions can be found here.

您可以关注link从迁移指南中,并将 idea 插件添加回 sbt。

但是,通常情况下,您应该能够准确地完成您正在做的事情。

  1. 如果尚未安装 Scala 插件,请安装 - 这不仅支持 Scala,还支持 Play 和 sbt
  2. "file">“打开”> 选择build.sbt
  3. 该项目将导入 IntelliJ

关于java - 导入sbt项目时出错: idea,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31307201/

相关文章:

java - 如何获得唯一的传入请求 IP 地址

java - 选择排序法

java - 为什么在 Android studio 中工作时无法获得清晰的图像?

java - JPA/Hibernate如何获取每个类别的N个项目

java - 为什么 IntelliJ 需要 Lombok 插件?

intellij-idea - 无法删除 IntelliJ/Cursive 中的括号

intellij-idea - 我们如何使用 Intellij ANTLR V4 插件测试 ANTLR Lexer 规则?

java - 游戏测试失败(游戏框架 2.2.2)

java - Observable.empty() 导致 java.util.NoSuchElementException : Sequence contains no elements

java - 渲染 Play Framework 2 View