【问题标题】:Running scalatest and Maven with two scala libraries - one for Maven, the other for Scala Eclipse plugin使用两个 scala 库运行 scalatest 和 Maven - 一个用于 Maven,另一个用于 Scala Eclipse 插件
【发布时间】:2012-11-16 16:23:54
【问题描述】:

scala Eclipse 插件需要 scala 2.10.0 才能运行:

要在 Maven 上运行“测试”目标,我需要依赖项:

<dependency>
    <groupId>org.scalatest</groupId>
    <artifactId>scalatest_2.9.0-1</artifactId>
    <version>2.0.M5</version>
</dependency>

作为此依赖项的一部分,“scala-library-2.9.0-1.jar”也被添加到构建路径中:

这会导致在 Eclipse 的问题选项卡上显示错误:

在构建路径中找到多个 scala 库。至少有一个 不兼容的版本。请更新项目构建路径,以便 仅包含兼容的 scala 库。

我该如何解决这个错误?我需要两个 scala 库,一个用于 scala eclipse 插件,另一个用于 scalatest maven 插件。我不想只是从问题选项卡中删除错误。

【问题讨论】:

    标签: scala maven


    【解决方案1】:

    scala Eclipse 插件需要 scala 2.10.0 才能运行:

    它有 2.10 和 2.9 的版本,安装 2.9.2 的版本(并为 2.9.2 版本使用 ScalaTest)。或者使用 ScalaTest 的 2.10 版本,但您似乎需要在本地构建和安装它,http://mvnrepository.com/artifact/org.scalatest 中没有列出适用于 2.10.0-RC2 的版本。

    【讨论】:

    猜你喜欢
    • 2012-11-20
    • 2011-10-09
    • 2020-12-14
    • 2015-10-25
    • 2011-08-09
    • 2016-09-22
    • 1970-01-01
    • 2014-08-23
    • 2016-02-27
    相关资源
    最近更新 更多