Skip to content

Instantly share code, notes, and snippets.

@kingargyle
Created March 10, 2016 17:15
Show Gist options
  • Save kingargyle/031fb7209b127743f49a to your computer and use it in GitHub Desktop.
Save kingargyle/031fb7209b127743f49a to your computer and use it in GitHub Desktop.
Add Nexus Mirrors to gradle builds with Init Script
// Replace the location of the nexus repository with your specific location.
// To enable this: gradlew build -I init.gradle
// This will now have gradle use the mirrors first and jcenter and other repositories second if it can't find the artifacts.
// Make sure your mirror Jcenter in your nexus repository.
allprojects{
buildscript{
repositories{
maven{ url 'http://localhost:8081/nexus/content/groups/public' }
}
}
repositories {
maven{ url 'http://localhost:8081/nexus/content/groups/public' }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment