1

I am trying to setup an sbt instance installed with the typesafe stack to only use my private nexus repository for all of the dependencies.

But no matter what I try, the dependencies are downloaded from http://repo.typesafe.com/typesafe/releases. I have tried many solutions and especially the ones explained here, here and here.

I have even tried to change the sbt.boot.properties inside the sbt-launch.jar but with no luck. Is there something special in the typesafe stack that prevents from changing the sbt behavior in that respect?

By the way, I want to use the nexus + local for everything, not just project dependencies: dependencies, plugins, everything that sbt needs to download.

Community
  • 1
  • 1
Oscar Picasso
  • 295
  • 2
  • 7

2 Answers2

3

Just wanted to say that in sbt 0.12, we specifically tried to address this need/concern. We now have full support of proxy repositories from the launcher -> project.

Basically, in sbt 0.12.3 (Play 2.1) just create a file: ~/.sbt/repositories

[repositories]
  local
  my-ivy-proxy-releases: http://repo.company.com/ivy-releases/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]
  my-maven-proxy-releases: http://repo.company.com/maven-releases/

Then when starting sbt, us a -Dsbt.override.build.repos=true

You can also specify different proxy files using -Dsbt.repository.config=<path-to-your-repo-file>

Hope this helps! - Josh

Please see: http://www.scala-sbt.org/release/docs/Detailed-Topics/Proxy-Repositories.html for more information.

jsuereth
  • 5,604
  • 40
  • 40
1

Check that you have cleared the contents of the following folder ~/.sbt , as it might contain references to a typesafe resolver.

In your Build.scala or any .sbt file (plugins or build) , make sure all your resolvers now point to your nexus repository.

Make sure your sbt launch script looks like this:

java -Dsbt.boot.properties=sbt.boot.properties -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256m -Xmx512M -Xss2M -jar dirname $0/sbt-launch.jar "$@"

Let me know if this does not work out.

Krishnen

krishnen
  • 172
  • 1
  • 1
  • 9
  • 1
    It's work fine. Thanks. Now a follow-up question. The repository need basic authentication, apart from storing the credentials in the url for the repository in sbt.boot.propeties what whould be the best place to set them? – Oscar Picasso Apr 14 '12 at 13:44