Skip to content

Instantly share code, notes, and snippets.

@sboardwell
Last active August 23, 2019 13:34
Show Gist options
  • Save sboardwell/7dabdea3f84366b2a71693362a60e96d to your computer and use it in GitHub Desktop.
Save sboardwell/7dabdea3f84366b2a71693362a60e96d to your computer and use it in GitHub Desktop.
def updateGroup(def name, def members) {
if (!repository.getRepositoryManager().exists(name)) {
repository.createMavenGroup(name, members)
}
def mgConfig = repository.getRepositoryManager().get(name).configuration.copy()
mgConfig.attributes['group']['memberNames'] = members
repository.repositoryManager.update(mgConfig)
}
updateGroup('maven-group',['maven-public', 'maven-central', 'maven-releases', 'spring-milestone', 'spring-release', 'jitpack', 'jenkins-release', 'maven-jenkinsci', 'jenkins-public', 'plugins-gradle', 'my-protected-repo'])
updateGroup('maven-group-snapshots',['maven-snapshots', 'apache-org-snapshots', 'spring-io-libs-snapshot', 'oss-sonatype-snapshots'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment