Skip to content

Instantly share code, notes, and snippets.

@bmuschko
Created April 7, 2016 12:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bmuschko/9e5c5f3233fc71831178c76a4ba2dcea to your computer and use it in GitHub Desktop.
Save bmuschko/9e5c5f3233fc71831178c76a4ba2dcea to your computer and use it in GitHub Desktop.
Gradle 2.13-rc1
initscript {
repositories {
mavenCentral()
}
dependencies {
// needed for syncSnapshot and syncStaging
classpath 'org.apache.maven.wagon:wagon-webdav-jackrabbit:2.10'
classpath 'commons-codec:commons-codec:1.10'
}
}
rootProject {
task(group: 'Repository', description: 'Sync local staging-repository to oss.sonatype.org.', 'syncCompanyStaging') << {
def stagingRepos = new org.apache.maven.wagon.repository.Repository('staging', 'http://xxx/nexus/content/repositories/releases')
def auth = new org.apache.maven.wagon.authentication.AuthenticationInfo()
auth.userName = 'nexusUserName'
auth.password = 'nexusPassword'
def wagon = new org.apache.maven.wagon.providers.webdav.WebDavWagon()
wagon.connect(stagingRepos, auth)
file('release').eachFile {
if (it.directory) {
wagon.putDirectory(it, it.name)
} else {
wagon.put(it, it.name)
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment