How to access a secured Nexus with sbt?

前端 未结 6 973
暗喜
暗喜 2020-11-27 12:37

I\'m trying to access a Nexus repository manager which requires some basic authentication. Everything works fine from Maven2 but when I try to configure things in SBT it can

6条回答
  •  日久生厌
    2020-11-27 13:04

    If SBT launcher is failing to download a new version of SBT from your proxy, and that ~/.sbt/boot/update.log is showing that you're getting 401 authentication errors, you can use the environment variable SBT_CREDENTIALS to specify where the ivy credential file is.

    Either of these should work and download the new sbt version:

    1. SBT_CREDENTIALS='/home/YOUR_USER_NAME/.ivy2/.credentials' sbt
    2. Putting export SBT_CREDENTIALS="/home/YOUR_USER_NAME/.ivy2/.credentials" in your .bashrc (or .zshrc), start a new shell session and then run sbt

    (You'll need have the ~/.ivy2/.credentials file setup like other answers here has shown)

    Source: https://github.com/sbt/sbt/commit/96e5a7957c830430f85b6b89d7bbe07824ebfc4b

提交回复
热议问题