【问题标题】:Could not find artifact org.scalatest:maven-scalatest-plugin:jar:1.0找不到工件 org.scalatest:maven-scalatest-plugin:jar:1.0
【发布时间】:2016-04-25 17:42:47
【问题描述】:

我正在尝试使用 maven 运行一些 scala 测试(FlatSpec 样式),但是,当我运行 mvn test 时出现以下错误。

找不到工件 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。

【问题讨论】:

    标签: eclipse scala maven scalatest


    【解决方案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

    【讨论】:

    • 我根据您的建议更改了版本。它比以前更进一步。但是,现在我收到这条消息:Exception in thread "ScalaTest-main" java.lang.IllegalArgumentException: ERROR: -p has been deprecated for a very long time and is no longer supported, to prepare for reusing it for a different purpose in the near future. Please change all uses of -p to -R 这发生在org.scalatest.tools.ArgsParser$.checkArgsForValidity(ArgsParser.scala:51) 有什么想法吗?
    • nvm,我从org.scalatest:scalatest_2.10:3.0.0-M15 降级到org.scalatest:scalatest_2.10:2.0.M6-SNAP8,现在一切正常。我将尝试慢慢增加该版本,看看会发生什么。
    猜你喜欢
    • 2016-05-22
    • 1970-01-01
    • 1970-01-01
    • 2014-06-10
    • 2021-07-15
    • 2016-09-19
    • 1970-01-01
    • 2016-08-04
    • 1970-01-01
    相关资源
    最近更新 更多