diff --git a/SpellChecker/build.gradle b/SpellChecker/build.gradle index c7231e8..7c027e0 100644 --- a/SpellChecker/build.gradle +++ b/SpellChecker/build.gradle @@ -51,18 +51,6 @@ repositories { mavenCentral() } 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('ossrhToken') ? ossrhToken : 'unknown' - password = project.hasProperty('ossrhTokenPassword') ? ossrhTokenPassword : 'unknown' - } - } - } publications { maven(MavenPublication) { diff --git a/build.gradle b/build.gradle index ba50c63..68b8112 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,9 @@ -//plugins { +plugins { // id 'com.github.spotbugs' version '5.0.12' -//} + 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 @@ -70,3 +73,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/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index a4b76b9..9bbc975 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradlew b/gradlew index f3b75f3..faf9300 100755 --- a/gradlew +++ b/gradlew @@ -205,7 +205,7 @@ fi DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Collect all arguments for the java command: -# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, # and any embedded shellness will be escaped. # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be # treated as '${Hostname}' itself on the command line. diff --git a/settings.gradle b/settings.gradle index ce2835a..7276fc7 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,3 +1,9 @@ +pluginManagement { + repositories { + gradlePluginPortal() + } +} + rootProject.name = 'SpellChecker' include 'SpellChecker', 'SpellCheckerDemo'