Skip to content

Instantly share code, notes, and snippets.

@sarveshseri
Last active September 7, 2019 20:38
Show Gist options
  • Save sarveshseri/7eb6b2f924d08e2853099b0d923d1769 to your computer and use it in GitHub Desktop.
Save sarveshseri/7eb6b2f924d08e2853099b0d923d1769 to your computer and use it in GitHub Desktop.
how to use sbt with custom repositories
realm=my maven repo
host=my-maven-repo-host.com
user=xxxx
password=yyyy
[repositories]
local
maven-local
my-maven-repo: https://my-maven-repo-host.com/my-maven-repo

The big downside is that it locks sbt to only these repositories

Create a file ~/.sbt/repositories as specified in repositories.

Create file ~/.sbt/.credentials as specified in credentials

Export the credentials path,

export SBT_CREDENTIALS=~/.sbt/.credentials

Create file ~/.sbt/.credentials as specified in credentials

Export the credentials path,

export SBT_CREDENTIALS=~/.sbt/.credentials

Now, just add the repository to reslovers whenever required in your project's build.sbt,

resolvers += "my-maven-repo" at "https://my-maven-repo-host.com/my-maven-repo"

If the exported credentials path does not work then add,

credentials += Credentials(Path.userHome / ".sbt" / ".credentials")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment