SBT找不到其他sbt文件中添加的解析器

时间:2018-10-29 09:25:20

标签: scala sbt

我有一个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/)

1 个答案:

答案 0 :(得分:1)

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

发现问题后,我将resolvers.sbt保留在项目目录中。我将其移至项目的主目录(其中存在build.sbt),现在可以解决了。