Prerequisite: Before connecting sbt to Artifactory, you must have an existing sbt repository in Artifactory. For more information, see Create an sbt Repository.
To connect sbt to Artifactory:
In the
~/.sbt/repositoriesfile, add the following text as relevant to configure your Artifactory repositories as proxies for sbt:[repositories] local my-ivy-proxy-releases: https://[JFrogPlatformURL]/artifactory/<REPO_NAME>/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext] my-maven-proxy-releases: https://[JFrogPlatformURL]/artifactory/<REPO_NAME>/
Where:
[JFrogPlatformURL]: The URL of your JPD<REPO_NAME>: The name of the target repository
For example:
[repositories] local my-ivy-proxy-releases: https://company.jfrog.io/artifactory/sbt-ivy/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext] my-maven-proxy-releases: https://company.jfrog.io/artifactory/sbt-maven/
Tip
It is best practice to proxy Ivy and Maven repositories separately. For more information, see Proxying Ivy Repositories in the sbt documentation.
To override resolvers in the sbt project and use the resolvers from the repositories configuration, add this configuration option to the sbt launcher script:
-Dsbt.override.build.repos=true
You can also add this setting to your
/usr/local/etc/sbtopts.
Note
You can also use JFrog Set me up to copy the snippet populated with your token and environment. For more information, see Use Artifactory Set Me Up for Configuring Package Manager Clients.
Next steps: