【问题标题】:Ivy/sbt bug for maven dependency that has variables, is there a fix yet?具有变量的 maven 依赖项的 Ivy/sbt 错误,是否有修复?
【发布时间】:2014-12-24 10:38:08
【问题描述】:

你可能有一个像我一样的设置,一个 maven2 构建,但不确定这是否会有所作为:

parent/pom.xml
parent/project/pom.xml <-depends on spring.version in parent

那么你的 sbt 构建有:

[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  :: org.springframework#spring-core;${spring.version}: not found
[error] unresolved dependency: org.springframework#spring-core;${spring.version}: not found

起初,谷歌搜索了几个小时,我找到了解决方法: https://groups.google.com/forum/#!topic/simple-build-tool/3OkYLXzHwG4

后来当我改变了我祝福构建的方式时,我不得不搜索我的浏览器历史才能再次找到它!

有没有更好的方法让其他人远离这个兔子洞?

编辑:前面提到的线程:

mvn help:effective-pom -P scala2.9.2 -Doutput=tmp.pom
mvn -f tmp.pom clean source:jar scala:doc-jar package deploy

我能够逃脱:

mvn help:effective-pom -Doutput=effective.pom && mvn -f effective.pom source:jar deploy

【问题讨论】:

    标签: scala maven sbt ivy


    【解决方案1】:

    使用 sbt 1.3.13,我能够使用以下项目运行 update 而不会出现错误:

    ThisBuild / scalaVersion     := "2.13.2"
    ThisBuild / version          := "0.1.0-SNAPSHOT"
    ThisBuild / organization     := "com.example"
    ThisBuild / organizationName := "example"
    
    lazy val root = (project in file("."))
      .settings(
        name := "parentpom",
        libraryDependencies += "com.googlecode.mapperdao" % "mapperdao" % "1.0.0.rc15-2.9.2"
      )
    

    我猜 Coursier 可以更好地处理 POM 文件。

    【讨论】:

      猜你喜欢
      • 2011-12-18
      • 2015-07-11
      • 2011-02-15
      • 1970-01-01
      • 2018-06-08
      • 1970-01-01
      • 2011-04-11
      • 2013-04-25
      • 2012-09-30
      相关资源
      最近更新 更多