2

I'm trying to use SBT behind a corporate firewall. I'm required to use a password-protected Artifactory to resolve dependencies.

I've got a plugin file which contains the following text:

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

I've tried this file in the following locations:

  • %USERPROFILE%.sbt\0.13\plugins\credentials.sbt
  • %USERPROFILE%.sbt\plugins\credentials.sbt
  • \project\project.sbt (added the line to an existing file)

None of them seem to have the desired effect of loading the credentials file. In fact there's absolutely nothing in the sbt.last.log file which suggests that this is the correct way to load credentials.

Can you help me?

  • How do I prove that a plugin loaded? Can put some kind of log message in plugins file so that I can verify that SBT actually loaded it?
  • What's the correct way to get a credentials object loaded on Windows? Is this actually the correct way to load it?

EDIT 0: I tried to put some garbage text in the locations above to see if I can make an error that was visible in the update.log file. I didn't get anything. From that I can safely conclude that my plugins aren't getting loaded at all.

EDIT 1: I've added this as an issue on SBT's issue tracker.

Salim Fadhley
  • 6,975
  • 14
  • 46
  • 83
  • Have you read this: http://stackoverflow.com/a/19598435/3248346 –  Dec 29 '16 at 15:19
  • Yes, I was trying to follow exactly those instructions. I've tried explictly adding the credentials and also using a credentials file. It never seems to work which suggests to me that the file isn't even loading. That's why I wanted to find out if there was a way of making SBT log which plugins were initializing. – Salim Fadhley Dec 29 '16 at 15:26
  • You have specified the path `credentials += Credentials(Path.userHome / ".sbt" / ".credentials")` and yet you put it elsewhere (%USERPROFILE%.sbt\0.13\plugins\...)? Shouldn't it be `%USERPROFILE%.sbt\0.13\.credentials` without `.sbt` extension? – insan-e Dec 29 '16 at 15:39
  • The naming is somewhat confusing: The text file containing the actual credentials is in %USERPROFILE%\.sbt\.credentials. The sbt file containing the "plugin" is in %USERPFOFILE%\.sbt\0.13\plugins\credentials.sbt – Salim Fadhley Dec 29 '16 at 15:55

1 Answers1

0

I think you need global settings, not global plugins. They are different. credentials setting expression must be placed in ~/.sbt/0.13/credential.sbt equivalent on Windows.

For more details on settings and plugins, see the Getting Started guide and Global settings for the details on using global settings.

Has your setup worked in previous sbt versions prior to 0.13.13, or are you saying that the version you're using is sbt 0.13.13. I'm guessing it's the latter.

Eugene Yokota
  • 94,654
  • 45
  • 215
  • 319