SBT is unable to find credentials when attempting to download from an Artifactory virtual repo

前端 未结 2 739
梦如初夏
梦如初夏 2020-12-09 05:31

I\'m trying to run SBT behind a corporate firewall. Another team has configured an Artifactory proxy. This proxy works fine with anonymous access switched on, but when we ma

2条回答
  •  我在风中等你
    2020-12-09 05:54

    I think the default location for this file is ${HOME}/.sbt//.credentials; while I trust there is published documentation on this, I confirmed this by clicking around in the code.
    @salim-fadhley, looks like you are missing the SBT version in the path.

    EDIT: You need to add DefaultOptions.addCredentials to your build.sbt; you can then verify what SBT picks up with show credentials.

    File location aside, there seems to be confusion between repository names (mean nothing) vs. security realms (mean everything).

    The auth-challenge that comes back from the repository server will include the name of the security realm; as a client/developer, you have no control over what it is and my guess is it must match the realm you (client/developer) specify in your .credentials file (wherever that is).

    Meanwhile, the repository name (as featured in build.sbt) actually means nothing to anyone outside development of the corresponding project e.g. the repository server admins could not care from one project to the next.

提交回复
热议问题