diff --git a/RSTALanguageSupport/build.gradle b/RSTALanguageSupport/build.gradle index 095166a..5d2b01d 100644 --- a/RSTALanguageSupport/build.gradle +++ b/RSTALanguageSupport/build.gradle @@ -43,18 +43,6 @@ test { } publishing { - repositories { - maven { - def releasesRepoUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/' - def snapshotsRepoUrl = 'https://oss.sonatype.org/content/repositories/snapshots/' - url = isReleaseVersion ? releasesRepoUrl : snapshotsRepoUrl - credentials { // Credentials usually kept in user's .gradle/gradle.properties - // We must defensively check for these properties so Travis CI build works - username = project.hasProperty('ossrhUsername') ? ossrhUsername : 'unknown' - password = project.hasProperty('ossrhPassword') ? ossrhPassword : 'unknown' - } - } - } publications { maven(MavenPublication) { diff --git a/build.gradle b/build.gradle index 7047be0..ba87a64 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,9 @@ -//plugins { -// id 'com.github.spotbugs' version '5.0.12' -//} +plugins { +// id 'com.github.spotbugs' version '6.4.8' + id 'io.github.gradle-nexus.publish-plugin' version '2.0.0' +} + +apply plugin: 'io.github.gradle-nexus.publish-plugin' // We require building with JDK 17 or later. Built artifact compatibility // is controlled by javaLanguageVersion @@ -15,7 +18,7 @@ allprojects { mavenLocal() mavenCentral() maven { - url = 'https://oss.sonatype.org/content/repositories/snapshots' + url = 'https://central.sonatype.com/repository/maven-snapshots/' } } @@ -78,3 +81,15 @@ subprojects { options.compilerArgs << '-Xlint:deprecation' << '-Xlint:unchecked' } } + +nexusPublishing { + repositories { + sonatype { + nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/")) + snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/")) + // We must defensively check for these properties so CI builds work + username.set(project.hasProperty('sonatypeUsername') ? sonatypeUsername : 'unknown') + password.set(project.hasProperty('sonatypePassword') ? sonatypePassword : 'unknown') + } + } +} diff --git a/settings.gradle b/settings.gradle index cb9604f..44842fe 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,3 +1,9 @@ +pluginManagement { + repositories { + gradlePluginPortal() + } +} + rootProject.name = 'RSTALanguageSupport' include 'RSTALanguageSupport', 'RSTALanguageSupportDemo'