Hi folks, I'm pretty green on all of this stuff, so I apologize if
I've misunderstood anything.
We've got an sbt (Scala) project that currently pulls artifacts from
the web. We'd like to move towards a corporate-standardized Nexus
repository that would cache artifacts. From the Nexus documentation, I
understand how to do that for Maven projects. But sbt obviously uses a
different approach. (I understand Ivy is involved somehow, but I've
never used it on its own and don't understand how it works.)
How do I tell sbt and/or the underlying Ivy to use the corporate Nexus
repository system for all dependencies? I'd like the answer to use
some sort of project-level configuration file, so that new clones of
our source repository will automatically use the proxy. (I.e., mucking
about with per-user config files in a dot-directory is not a viable
solution.)
I've tried asking this question on Stack Overflow (http://
stackoverflow.com/questions/3770125/how-do-i-get-sbt-to-use-a-local-
maven-proxy-repository-nexus), but the only response doesn't seem to
work. That approach was to use an sbt.boot.properties file and start
sbt as:
java -Xmx1024M -Dsbt.boot.properties="sbt.boot.properties" -jar
`dirname $0`/sbt-launch.jar "$@"
I've confirmed that the file is being read (changing the scala version
to something like 2.9.7 triggers an error), but modifying the
[repositories] block seems to make no difference at all. I delete the
~/.ivy2/cache/org.squeryl/ directory, run "sbt update", and even with
the following repositiories block, it re-pulls Squeryl from scala-
tools.org.
[repositories]
local
my-nexus:
http://our.corporate.nexus:9001/nexus/content/groups/public/,
[organization]/[module]/[revision]/[type]s/[artifact](-[classifier]).
[ext]
maven-local
# sbt-db:
http://databinder.net/repo/, [organization]/[module]/
[revision]/[type]s/[artifact](-[classifier]).[ext]
# maven-central
# scala-tools-releases
# scala-tools-snapshots
So what's going on? Does this properties file have anything at all to
do with how project dependencies are pulled? Or does it only apply to
the sbt bootstrap process? And if that's the case, what's the correct
way to force sbt to use the Nexus system as a proxy?
And, of course, what basic concepts am I completely missing? :)
Thanks a lot!
-Harlan