Skip to content

Commit

Permalink
Refs #11 - updated to publish to nexus staging repo and release to ma…
Browse files Browse the repository at this point in the history
…ven central. (#12)
  • Loading branch information
cbmarcum authored Apr 30, 2021
1 parent 996a78d commit 8947efc
Showing 1 changed file with 26 additions and 3 deletions.
29 changes: 26 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,17 @@
*************************************************************/

/* build with:
* ./gradlew publish
* ./gradlew publish (this pushed to nexus staging repo also)
* nexus-plugin docs say to use:
* ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository
* or:
* ./gradlew publishToSonatype closeSonatypeStagingRepository
* or to publish locally
* ./gradlew publishToMavenLocal
*/
*
* to update this wrapper version
* $ gradle wrapper --gradle-version 6.7 --distribution-type all
*/

plugins {
id 'groovy'
Expand All @@ -33,6 +40,7 @@ plugins {
id 'maven-publish'
// https://docs.gradle.org/current/userguide/signing_plugin.html
id 'signing'
id("io.github.gradle-nexus.publish-plugin") version "1.0.0"
}

repositories {
Expand All @@ -43,7 +51,7 @@ repositories {
}

group 'net.codebuilders'
version "4.1.6.14" // based on AOO version and patch number
version "4.1.6.15" // based on AOO version and patch number
description 'Groovy UNO Extension extends the Apache OpenOffice UNO API'
mainClassName = 'org.openoffice.FakeClassName'

Expand Down Expand Up @@ -165,6 +173,21 @@ signing {
sign configurations.archives
}

nexusPublishing {
repositories {
sonatype {
def ossUser = System.getenv("SONATYPE_USERNAME") ?: project.hasProperty("sonatypeOssUsername") ? project.sonatypeOssUsername : ''
def ossPass = System.getenv("SONATYPE_PASSWORD") ?: project.hasProperty("sonatypeOssPassword") ? project.sonatypeOssPassword : ''
def ossStagingProfileId = System.getenv("SONATYPE_STAGING_PROFILE_ID") ?: project.hasProperty("sonatypeOssStagingProfileId") ? project.sonatypeOssStagingProfileId : ''
// nexusUrl = uri("https://s01.oss.sonatype.org/service/local/")
// snapshotRepositoryUrl = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
username = ossUser
password = ossPass
stagingProfileId = ossStagingProfileId
}
}
}

// MAY WANT THIS WITH GROOVYDOC ??
javadoc {
if (JavaVersion.current().isJava9Compatible()) {
Expand Down

0 comments on commit 8947efc

Please sign in to comment.