gpt4 book ai didi

sbt - 为什么 SBT 不使用根项目中的解析器(在多模块项目中)

转载 作者:行者123 更新时间:2023-12-04 14:00:59 26 4
gpt4 key购买 nike

在多模块项目中,SBT 似乎没有使用 resolvers在构建模块时。解析器在根项目的 build.sbt 中声明。如下:

resolvers += "SpringSource Milestone Repository" at "http://repo.springsource.org/milestone"

项目声明如下:
lazy val core = project.settings(
libraryDependencies ++= { ... }
)

但是在编译时,没有使用解析器,我得到:
[info] Resolving org.springframework.scala#spring-scala;1.0.0.BUILD-SNAPSHOT ...
[warn] module not found: org.springframework.scala#spring-scala;1.0.0.BUILD-SNAPSHOT
[warn] ==== local: tried
[warn] /home/ariskk/.ivy2/local/org.springframework.scala/spring-scala/1.0.0.BUILD-SNAPSHOT/ivys/ivy.xml
[warn] ==== public: tried
[warn] http://repo1.maven.org/maven2/org/springframework/scala/spring-scala/1.0.0.BUILD-SNAPSHOT/spring-scala-1.0.0.BUILD-SNAPSHOT.pom
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.springframework.scala#spring-scala;1.0.0.BUILD-SNAPSHOT: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::

有什么想法可能是错的吗?

最佳答案

在根项目的 build.sbt 中使用以下内容:

resolvers in ThisBuild += "SpringSource Milestone Repository" at "http://repo.springsource.org/milestone"
in ThisBuild是答案。见 Scopes .

关于sbt - 为什么 SBT 不使用根项目中的解析器(在多模块项目中),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21211424/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com