SBT Repository

Artifactory provides tight integration with SBT allowing your builds to resolve artifacts from and deploy builds to Artifactory.

SBT Repository Features:

The JFrog Platform

Documentation

SBT Repositories Wiki

Article

Deep Recursive Scanning

Article

SBT integration

SBT FAQ

How can I configure SBT to use JFrog Artifactory as a resolver?

To configure SBT to use JFrog Artifactory, you can add the following lines to your build.sbt file:

resolvers += “Artifactory” at “https:///artifactory//”

Replace with your Artifactory server URL and with the appropriate repository name.

How do I publish my SBT artifacts to JFrog Artifactory?

To publish artifacts, add the following settings to your build.sbt:

publishTo := Some(“Artifactory” at “https:///artifactory//”)
credentials += Credentials(“Artifactory Realm”, “”, “”, “”)

Replace placeholders with your specific details. When you run sbt publish, your artifacts will be sent to the specified repository in Artifactory.

How can I manage dependencies stored in JFrog Artifactory?

To manage dependencies, use the standard SBT dependency syntax in your build.sbt file while ensuring Artifactory is configured as a resolver. For example:

libraryDependencies += “com.example” %% “my-library” % “1.0.0”

SBT will look for the specified library in the configured Artifactory repository, resolving the dependencies accordingly.

What credentials are required for SBT to interact with JFrog Artifactory?

SBT needs valid credentials that provide access to the specified repositories in Artifactory. You can store these credentials in your ~/.sbt/1.0/global.sbt file or specify them directly in your build.sbt:

credentials += Credentials(“Artifactory Realm”, “”, “”, “”)

Ensure that you replace the placeholder values with actual information.

Can SBT resolve snapshots from JFrog Artifactory?

Yes, SBT can resolve snapshot versions from JFrog Artifactory. Ensure you have a separate repository for snapshots in Artifactory, then add it to your resolvers in build.sbt:

resolvers += “Artifactory Snapshots” at “https:///artifactory//”

SBT will resolve dependencies from the specified snapshot repository accordingly.

Trusted Releases Built For Speed

About SBT

sbt is a build tool for Scala, Java, and more.
Learn More! Book a session with our technical team