IntelliJ IDEA不再允许我从SBT项目运行ScalateTests
我在IntelliJ IDEA中有一个奇怪的问题:我有一个SBT项目,它有伸缩测试。我将我的设置组织在块中,如下所示:IntelliJ IDEA不再允许我从SBT项目运行ScalateTests,scala,intellij-idea,scalatest,Scala,Intellij Idea,Scalatest,我在IntelliJ IDEA中有一个奇怪的问题:我有一个SBT项目,它有伸缩测试。我将我的设置组织在块中,如下所示: lazy val common = Seq( organization := "com.example.foo", version := "0.0.1-SNAPSHOT", scalaVersion := "2.10.5", fork in Test := true, testListeners += new JUnitXmlTestsListener(
lazy val common = Seq(
organization := "com.example.foo",
version := "0.0.1-SNAPSHOT",
scalaVersion := "2.10.5",
fork in Test := true,
testListeners += new JUnitXmlTestsListener(
new File(target.value, "test-reports").getAbsolutePath
)
)
lazy val testWithScalatest = Seq(
libraryDependencies += "org.scalatest" %% "scalatest" % "2.2.4" % "test"
)
lazy val bar = project.in(file("some/where/foo/bar")).settings(common).settings(testWithScalatest).settings(name:="bar")
Error running ScalaTests in 'bar': Cannot start process, the working directory C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 14.1.4\jre\jre\bin does not exist
当我运行sbt测试时
,测试运行良好,没有任何错误。但是,当我右键单击IDEA项目浏览器中的测试类时,“运行测试”选项不在那里。我可以右键单击测试类所在的包,然后选择“在中运行ScalateTests…”,但我会得到如下结果:
lazy val common = Seq(
organization := "com.example.foo",
version := "0.0.1-SNAPSHOT",
scalaVersion := "2.10.5",
fork in Test := true,
testListeners += new JUnitXmlTestsListener(
new File(target.value, "test-reports").getAbsolutePath
)
)
lazy val testWithScalatest = Seq(
libraryDependencies += "org.scalatest" %% "scalatest" % "2.2.4" % "test"
)
lazy val bar = project.in(file("some/where/foo/bar")).settings(common).settings(testWithScalatest).settings(name:="bar")
Error running ScalaTests in 'bar': Cannot start process, the working directory C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 14.1.4\jre\jre\bin does not exist
当我尝试编辑运行配置时,“运行/调试配置”窗口中的设置面板为空
我也无法添加新配置
这里有什么问题
编辑:我在使用Specs2时遇到了同样的问题。我解决了它。我重新安装了IntelliJ IDEA并删除了我的
.ideaIC14
文件夹。然后我重新运行了gitclean-fdx
和sbtclean
。似乎有些内部缓存不稳定
下一次,我尝试在重新安装所有内容之前,如果
使缓存无效/重新启动
就足够了我想,您在构建项目时没有在配置窗口中指定工作目录
将其指定到项目根目录,可能会解决问题:)您是否尝试过:rm-r目标和sbt清理,然后在IntelliJ中重建项目?我尝试过与rm-r目标相同的
git clean-fdx
,并且尝试过sbt清理
,但问题依然存在。最奇怪的是:它抱怨的目录确实存在!我当时确实没有检查这个问题,但是对于以前运行的ScalateTests,这个问题也发生在我身上。他们工作了,不知怎么突然停了下来。但是我也浏览了Git分支,并在命令行上做了一些相关的工作,所以我认为这会把索引搞砸。