Skip to content

Commit

Permalink
Gradle magic to publish to Maven Central
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Domsch <[email protected]>
  • Loading branch information
matt-domsch-sp committed May 7, 2021
1 parent 441ff19 commit c3dabee
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ plugins {
id 'signing'
}

version = '0.2.0-SNAPSHOT'

repositories {
mavenCentral()

Expand Down Expand Up @@ -42,6 +44,8 @@ java {
withSourcesJar()
}

ext.isReleaseVersion = !version.endsWith("SNAPSHOT")

publishing {
publications {
model(MavenPublication) {
Expand Down Expand Up @@ -83,6 +87,15 @@ publishing {
name = 'myRepo'
url = "file://${buildDir}/repo"
}
maven {
def releaseRepo = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotRepo = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
url = isReleaseVersion ? releaseRepo : snapshotRepo
credentials {
username = project.hasProperty('ossrhUsername') ? ossrhUsername : "Unknown user"
password = project.hasProperty('ossrhPassword') ? ossrhPassword : "Unknown password"
}
}
}
}

Expand All @@ -98,6 +111,5 @@ signing {
}

group = 'com.sailpoint'
version = '0.1.0-SNAPSHOT'
sourceCompatibility = 9;
targetCompatibility = 9;

0 comments on commit c3dabee

Please sign in to comment.