Skip to content

Consume Central with SBT⚓︎

The default SBT configuration includes resolving components from the Central Repository via HTTP as documented in the library management documentation.

To access the Central Repository with sbt via HTTPS you can add a new resolver for the secured Central Repository, while disabling the default, in your build.sbt file

resolvers += "Secured Central Repository" at "https://repo1.maven.org/maven2"

externalResolvers := Resolver.withDefaultResolvers(resolvers.value, mavenCentral = false)

Alternatively you can add it as a global repository in ~/.sbt/repositories

[repositories]
local
secured-central: https://repo1.maven.org/maven2

and set sbt.override.build.repos=true when running sbt.

Back to top