【问题标题】:SBT not finding resolvers added in another sbt fileSBT 未找到添加到另一个 sbt 文件中的解析器
【发布时间】:2019-04-02 04:45:06
【问题描述】:

我有一个 SBT 项目,我在 build.sbt 中添加了解析器。现在,我没有在 build.sbt 文件中添加解析器,而是尝试放入一个新文件 resolvers.sbt。 但是如果我在单独的文件中制作解析器,SBT 将无法找到工件。但是,我可以在启动 SBT 时看到消息,即我的 resolvers.sbt 正在考虑中。

如果我将解析器添加到.sbt 目录中的全局文件中,它就会被解析。

sbt 版本:1.2.6

有没有其他人遇到过同样的问题?

build.sbt

import sbt.Credentials

name := "sbt-sample"

version := "0.1"

scalaVersion := "2.11.7"

libraryDependencies ++= Seq(
  "com.reactore" %% "reactore-infra" % "1.0.0.0-DEV-SNAPSHOT"
)

resolvers.sbt

credentials += Credentials("Artifactory Realm", "192.168.1.120", "yadu", "password")

resolvers ++= Seq(
  "Reactore-snapshots" at "http://192.168.1.120:8182/artifactory/libs-snapshot-local"
)

SBT 日志

sbt:sbt-sample> reload
[info] Loading settings for project global-plugins from idea.sbt ...
[info] Loading global plugins from /home/administrator/.sbt/1.0/plugins
[info] Loading settings for project sbt-sample-build from resolvers.sbt ...
[info] Loading project definition from /home/administrator/source/poc/sbt-sample/project
[info] Loading settings for project sbt-sample from build.sbt ...
[info] Set current project to sbt-sample (in build file:/home/administrator/source/poc/sbt-sample/)

【问题讨论】:

    标签: scala sbt


    【解决方案1】:

    我在这里回答我自己的问题,希望对其他人有用。

    发现了问题,我将 resolvers.sbt 保存在项目目录中。我将它移动到项目的主目录(存在 build.sbt),现在它正在解析。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-07-20
      • 2013-05-16
      • 2013-01-19
      • 2018-11-11
      • 1970-01-01
      • 2014-10-23
      • 2016-11-21
      • 2016-10-16
      相关资源
      最近更新 更多