gpt4 book ai didi

java - 使用 sbt 从不同解析器检索最新的 SNAPSHOT

转载 作者:行者123 更新时间:2023-12-01 13:24:05 25 4
gpt4 key购买 nike

我正在使用 play 2.2.1 和 sbt 0.13.0 编写一个应用程序。在此应用程序中,我依赖于另一个项目,该项目是一个快照,我也对其进行了一些修改。如果我构建该项目,它将写入我的本地 Maven 存储库。但通常应该从私有(private)在线 Maven 存储库检索该项目。

如何配置 sbt 以始终​​检索快照的最新版本,无论是否必须从本地 Maven 存储库或在线 Maven 存储库检索它。

到目前为止,我已将其添加到我的 build.sbt 中:

resolvers += "Online Repo" at "https://online-repo.com/somePath"
resolvers += "Local Maven Repository" at "file:///"+Path.userHome.absolutePath+"/.m2/"
libraryDependencies += "com.some.project" % "a-project" % "2.0-SNAPSHOT"

问题在于该项目是从第一个解析器检索的。在本例中为“在线 repo ”。尽管“本地 Maven 存储库”中的快照可能更新。

最佳答案

How can I configure sbt to always retrieve the newest version of the snapshot, regardless if it has to be retrieved from my local Maven repository or the online Maven repository.

根据Dependency Management Flow :

update resolves dependencies according to the settings in a build file, such as libraryDependencies and resolvers.

Directly running the update task (as opposed to a task that depends on it) will force resolution to run, whether or not configuration changed. This should be done in order to refresh remote SNAPSHOT dependencies.

这意味着 SBT 是有意这样做的。

关于java - 使用 sbt 从不同解析器检索最新的 SNAPSHOT,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21878164/

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