Skip to content

Instantly share code, notes, and snippets.

@xiaodongw
Created December 5, 2014 17:14
Show Gist options
  • Select an option

  • Save xiaodongw/deff30ff4905ffcebf12 to your computer and use it in GitHub Desktop.

Select an option

Save xiaodongw/deff30ff4905ffcebf12 to your computer and use it in GitHub Desktop.
Gradle - publish snapshot & release to different places
apply plugin: 'maven-publish'
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
repositories {
maven {
credentials {
username "anonymous"
}
if(project.version.endsWith('-SNAPSHOT')) {
url "http://example/artifactory/libs-snapshot-local"
} else {
url "http://example/artifactory/libs-release-local"
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment