void apply(Gradle gradle) { // ONLY USE NEXUS REPO FOR DEPENDENCIES gradle.allprojects { project -> project.repositories { // Remove all repositories not pointing to the NEXUS repository url all { ArtifactRepository repo ->
if ((repo instanceof MavenArtifactRepository) && repo.url.toString() != NEXUS_REPO){ if ((repo.url.toString() == GOOGLE_REPOSITORY_URL) ||
(repo.url.toString() == JCENTER_REPOSITORY_URL) || (repo.url.toString() == MAVEN_REPOSITORY_URL) ) { project.logger.lifecycle "Repository ${repo.name} removed. Only NEXUS REPOSITORY is allowed" remove repo } } } // add the NEXUS repository maven { name "NEXUS_REPO" url NEXUS_REPO } } } } }