Skip to content

Commit

Permalink
Adding ability to publish both releases and SNAPSHOTs directly to Son…
Browse files Browse the repository at this point in the history
…atype
  • Loading branch information
bobbylight committed Jan 2, 2015
1 parent 3e1f974 commit fd3d286
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
16 changes: 14 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,18 @@ repositories {
uploadArchives {
repositories {
mavenDeployer {
repository(url: 'file:///' + projectDir + '/../localMavenRepo')
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
if (project.hasProperty('upload') && Boolean.parseBoolean(upload)) { // gradlew -Pupload=true
repository(url: 'https://oss.sonatype.org/service/local/staging/deploy/maven2/') {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
snapshotRepository(url: 'https://oss.sonatype.org/content/repositories/snapshots/') {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
}
else {
repository(url: 'file:///' + projectDir + '/../localMavenRepo')
}
pom {
groupId = 'com.fifesoft'
name = 'autocomplete'
Expand Down Expand Up @@ -143,7 +153,9 @@ uploadArchives {
url 'https://github.com/bobbylight/AutoComplete'
connection 'scm:git:git://github.com/bobbylight/AutoComplete'
developerConnection 'scm:git:git@github.com:bobbylight/AutoComplete'
tag '2.5.4'
if (!project.version.endsWith('-SNAPSHOT')) {
tag project.version
}
}

developers {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Note that Maven- and signing-related properties are in <gradle-user-home>/gradle.properties
javaVersion=1.5
version=2.5.4
version=2.6.0-SNAPSHOT

0 comments on commit fd3d286

Please sign in to comment.