Skip to content

Instantly share code, notes, and snippets.

@Centaur
Forked from vrischmann/.credentials
Last active August 29, 2015 14:08
Show Gist options
  • Save Centaur/cac50ed4105a3332137c to your computer and use it in GitHub Desktop.
Save Centaur/cac50ed4105a3332137c to your computer and use it in GitHub Desktop.
realm=Sonatype Nexus Repository Manager
host=nexus.company.com
user=admin
password=admin123
export SBT_CREDENTIALS="$HOME/.ivy2/.credentials"
export SBT_OPTS="-Dsbt.override.build.repos=true -Dfile.encoding=UTF8 -Xms1024m -Xmx1024m -Xss1M -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256m"

WARNING Not tested with the sbt script from the Debian package, if you use it be sure to check the .sbtconfig is correctly imported.

Instructions

  • Put .sbtconfig in $HOME/.sbtconfig
  • Put credentials.sbt in $HOME/.sbt/0.13/plugins/credentials.sbt
  • Put .credentials in $HOME/.ivy2/.credentials
  • Put repositoriesin $HOME/.sbt/repositories

Nexus configuration

On your Nexus instance, you need to create two "Repository Groups", one called ivy and one called maven. The ivy one should include these two repositories:

The maven one should include at least the Maven Central repository, already configured in Nexus by default. You can add in this group any other repository you want, like the Aapche Snapshots repository or whatever.

credentials += Credentials(Path.userHome / ".ivy2" / ".credentials")
[repositories]
local
my-ivy-proxy-releases: http://nexus.company.com/nexus/content/groups/ivy/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]
my-maven-proxy-releases: http://nexus.company.com/nexus/content/groups/maven/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment