IntelliJ IDEA中有一個奇怪的問題:我有一個擁有ScalaTests的SBT項目。我在塊組織了我的設置是這樣的:IntelliJ IDEA不允許我從SBT項目運行ScalaTests
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")
當我運行sbt test
,測試沒有任何錯誤,運行良好。但是,當我在IDEA的項目瀏覽器中右鍵單擊測試類時,「運行測試」選項不存在。我可以右鍵單擊該包中的測試類是在和「...運行ScalaTests」選擇,但後來我得到這樣的:
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時有同樣的問題。
你嘗試過:RM -r目標和SBT乾淨,然後重建中的IntelliJ項目? –
我嘗試了'git clean -fdx',它和'rm -r target'一樣,並且做了'sbt clean',但問題依然存在。 – rabejens
最奇怪的是:它抱怨的目錄* DOES *存在! – rabejens