Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the default repositories that SBT uses?

Tags:

scala

sbt

I can provide a ~/.sbt/repositories file to override the repositories that SBT uses for resolving dependencies. When the file is present the default repositories aren't used.

What are the default repositories in SBT (0.13)? I want to add them to my repositories file so I can resolve dependencies inside and outside the network without having to change/move the file.

like image 685
Alessandro Vermeulen Avatar asked Jan 26 '16 07:01

Alessandro Vermeulen


People also ask

What is sbt repository?

sbt/repositories. The repositories file is an external configuration for the Launcher. The exact syntax for the configuration file is detailed in the sbt Launcher Configuration.

Where is sbt local repository?

The publishLocal action is used to publish your project to your Ivy local file repository, which is usually located at $HOME/. ivy2/local/ . You can then use this project from other projects on the same machine.

Does sbt use Ivy?

By default, sbt uses the standard Ivy home directory location ${user. home}/. ivy2/ . This can be configured machine-wide, for use by both the sbt launcher and by projects, by setting the system property sbt.

Where are sbt dependencies stored?

If you have JAR files (unmanaged dependencies) that you want to use in your project, simply copy them to the lib folder in the root directory of your SBT project, and SBT will find them automatically.


1 Answers

If you want to add to the default repositories (instead of replacing them), I think the easiest would be to create an .sbt file inside ~/sbt/0.13/, e.g. ~/sbt/0.13/my-resolvers.sbt:

resolvers += "Oracle Repository" at "http://download.oracle.com/maven"

Otherwise, you can find out in the sbt console via show externalResolvers. The entries are stored in sbt.boot.properties, which ends up as the sbt/sbt.boot.properties file in the launcher jar (for example ~/.sbt/launchers/0.13.17/sbt-launch.jar):

[repositories]
  local
  local-preloaded-ivy: file:///${sbt.preloaded-${sbt.global.base-${user.home}/.sbt}/preloaded/}, [organization]/[module]/[revision]/[type]s/[artifact](-[classifier]).[ext]
  local-preloaded: file:///${sbt.preloaded-${sbt.global.base-${user.home}/.sbt}/preloaded/}
  maven-central
  typesafe-ivy-releases: https://repo.typesafe.com/typesafe/ivy-releases/, [organization]/[module]/[revision]/[type]s/[artifact](-[classifier]).[ext], bootOnly
sbt-ivy-snapshots: https://repo.scala-sbt.org/scalasbt/ivy-snapshots/, [organization]/[module]/[revision]/[type]s/[artifact](-[classifier]).[ext], bootOnly
like image 69
0__ Avatar answered Oct 04 '22 20:10

0__