gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-04 18:12:34 25 4
gpt4 key购买 nike

我在 Windows 上运行 SBT 1.1.1。

如果我将以下行放在 build.sbt 中,我的构建就可以了:

credentials += Credentials(Path.userHome / ".sbt" / ".credentials")

问题是,我并不特别想在我的项目中留下这种特定于机器的配置。另外,为了使用 g8 模板,我需要有一个有效的全局配置。

但是如果我将相同的文本放在一个名为 的文件中凭证.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 加载插件。 - 这对我来说意义不大,版本号不匹配。即使我知道正在读取文件,我仍然收到错误消息。

    最佳答案

    Bizarrely, even though I'm running sbt-1.1.1 it seems to be wanting to load plugins from %USERPROFILE%.sbt\1.0\plugins - which makes very little sense to me, the version numbers do not match.



    sbt/sbt#3858关于这个问题。您应该将您的凭据文件放在 ~/.sbt/1.0/credentials.sbt 中(与任何其他全局设置相同)。

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

    关于sbt - SBT 凭据配置应该放在哪里?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49174141/

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