SBT凭据配置应该放在哪里?

SBT凭据配置应该放在哪里?,sbt,Sbt,我正在Windows上运行SBT1.1.1 如果我在build.sbt中放入以下行,则我的build就可以了: credentials += Credentials(Path.userHome / ".sbt" / ".credentials") 问题是,我并不特别想在我的项目中保留这种特定于机器的配置。此外,为了使用g8模板,我需要一个工作的全局配置 但是,如果我将相同的文本放在一个名为credentials.sbt的文件中,放在以下目录中,它似乎不起作用 %USERPROFILE%/.s

我正在Windows上运行SBT1.1.1

如果我在build.sbt中放入以下行,则我的build就可以了:

credentials += Credentials(Path.userHome / ".sbt" / ".credentials")
问题是,我并不特别想在我的项目中保留这种特定于机器的配置。此外,为了使用g8模板,我需要一个工作的全局配置

但是,如果我将相同的文本放在一个名为credentials.sbt的文件中,放在以下目录中,它似乎不起作用

  • %USERPROFILE%/.sbt/1.1/plugins/credentials.sbt
  • %USERPROFILE%/.sbt/1.1/credentials.sbt
  • %USERPROFILE%/.sbt/plugins/credentials.sbt
那么这个文件应该放在哪里呢

无论我将文件放在哪个位置,都会出现以下错误:

C:\workspace\tmp>c:\apps\sbt-1.1.1\bin\sbt.bat new sbt/scala-seed.g8
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
[info] Loading settings from credentials.sbt ...
[info] Loading global plugins from C:\Users\NBKA0O5\.sbt\1.0\plugins
[info] Updating ProjectRef(uri("file:/C:/Users/NBKA0O5/.sbt/1.0/plugins/"), "global-plugins")...
[error] Unable to find credentials for [Artifactory Realm @ artifactory.company.com].
[error] Unable to find credentials for [Artifactory Realm @ artifactory.company.com].
我知道我的凭证必须是好的,因为我首先使用完全相同的凭证来启动SBT

奇怪的是,尽管我运行的是sbt-1.1.1,但它似乎想从
%USERPROFILE%\.sbt\1.0\plugins
加载插件,这对我来说意义不大,版本号不匹配。即使我知道文件正在读取,我仍然会收到错误消息

奇怪的是,尽管我运行的是sbt-1.1.1,但它似乎想从%USERPROFILE%.sbt\1.0\plugins加载插件-这对我来说意义不大,版本号不匹配

关于这个问题,请参见。您应该将凭据文件放入
~/.sbt/1.0/credentials.sbt
(与任何其他全局设置相同)

还请注意,自SBT1.0以来,
凭证
是一项任务,因此,如果您必须将实际凭证存储在其他地方(环境变量或从另一个文件解析),则每次使用时都应重新评估它