【问题标题】:using external ivy for sbt build使用外部常春藤进行 sbt 构建
【发布时间】:2019-11-07 16:29:21
【问题描述】:

在我的工作场所,我们开始使用 Scala。对于依赖项和构建,我们使用 ivy.xml 文件。我正在努力让 build.sbt 与 ivy.xml 一起使用。

https://www.scala-sbt.org/0.13/docs/Library-Management.html#External+Maven+or+Ivy 我查看了本指南,但示例代码不起作用。 [以下是我的 build.sbt 中的内容]

externalIvyFile(Def.setting(baseDirectory.value / "ivy.xml"))
classpathConfiguration in Compile := Compile
classpathConfiguration in Test := Test
classpathConfiguration in Runtime := Runtime
[error] java.lang.RuntimeException: unrecognized module settings: IvyFileConfiguration(false, Some(ScalaModuleInfo(2.12.8, 2.12, Vector(), true, false, true, org.scala-lang, Vector(scala-library, scala-compiler, scala-reflect, scala-actors, scalap))), /work/scalawork/local.study.exchanger/ivy.xml, true)

上面是我返回的错误代码。 sbt-1.2.8 scala-2.12.8 ivy-2.0

【问题讨论】:

    标签: scala sbt ivy


    【解决方案1】:

    您是否在 build.sbt 的顶部声明了 externalIvySettings()

    externalIvySettings()
    externalIvyFile(Def.setting(baseDirectory.value / "ivy.xml"))
    classpathConfiguration in Compile := Compile
    classpathConfiguration in Test := Test
    classpathConfiguration in Runtime := Runtime
    

    【讨论】:

    • 不,因为它是可选的,我们不使用外部设置文件。但是我尝试添加该行并仍然遇到相同的错误。好问题。
    猜你喜欢
    • 2018-01-06
    • 1970-01-01
    • 1970-01-01
    • 2017-05-18
    • 1970-01-01
    • 2016-12-21
    • 2018-07-07
    • 1970-01-01
    • 2020-02-10
    相关资源
    最近更新 更多