2016-01-20 128 views
0

我想不過來運行使用maven一些斯卡拉測試(FlatSpec風格),當我運行mvn test我碰到下面的錯誤。找不到神器org.scalatest:Maven的scalatest-插件:罐子:1.0

Could not find artifact org.scalatest:maven-scalatest-plugin:jar:1.0

我從以下和https://github.com/scalatest/scalatest-maven-pluginhttp://www.scalatest.org/user_guide/using_the_scalatest_maven_plugin說明。我注意到這個git倉庫的最近更新是2年前。這個插件仍然是從maven運行scala測試的事實標準方式嗎?

從這個網站,http://ladstatt.blogspot.com/2012/06/testing-with-maven-scaladin-scalatest.html,它說添加pluginRepository,但這並不能幫助作爲錯誤仍然顯示。

我使用Scala的v2.10.6和Maven 3.3.3。

回答

1

你的鏈接將顯示插件應該是1.0-SNAPSHOT版本。事實上,你可以在這裏看到:https://oss.sonatype.org/content/groups/public/org/scalatest/maven-scalatest-plugin/只有那個版本。所以請檢查你的插件聲明pom.xml。它應該包含<version>1.0-SNAPSHOT</version>而不是1.0

+0

我每次您的意見改變了版本。它比以前更進一步。然而,現在我得到這樣的消息:'線程中的異常「ScalaTest-main」java.lang.IllegalArgumentException:錯誤:-p已經被棄用了很長時間,不再被支持,準備重用它用於不同的目的在不遠的將來。請將-p更改爲-R'的所有用法 發生這種情況'org.scalatest.tools.ArgsParser $ .checkArgsForValidity(ArgsParser.scala:51)' 任何想法? scalatest_2.10: –

+0

NVM,我從'org.scalatest降級3.0.0-M15'到'org.scalatest:scalatest_2.10:2.0.M6-SNAP8'和一切正常了。我會試着慢慢增加這個版本,看看會發生什麼。 –