Skip to content

Commit f6eaed3

Browse files
committed
Get publishing to gradle working with gradle-nexus/publish-plugin
1 parent 72408f5 commit f6eaed3

File tree

3 files changed

+25
-15
lines changed

3 files changed

+25
-15
lines changed

AutoComplete/build.gradle

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ base {
99
}
1010

1111
dependencies {
12-
api 'com.fifesoft:rsyntaxtextarea:3.5.4'
12+
api 'com.fifesoft:rsyntaxtextarea:3.6.1'
1313
}
1414

1515
ext.isReleaseVersion = !project.version.endsWith('SNAPSHOT')
@@ -29,18 +29,6 @@ jar {
2929
}
3030

3131
publishing {
32-
repositories {
33-
maven {
34-
def releasesRepoUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
35-
def snapshotsRepoUrl = 'https://oss.sonatype.org/content/repositories/snapshots/'
36-
url = isReleaseVersion ? releasesRepoUrl : snapshotsRepoUrl
37-
credentials { // Credentials usually kept in user's .gradle/gradle.properties
38-
// We must defensively check for these properties so CI builds work
39-
username = project.hasProperty('ossrhToken') ? ossrhToken : 'unknown'
40-
password = project.hasProperty('ossrhTokenPassword') ? ossrhTokenPassword : 'unknown'
41-
}
42-
}
43-
}
4432
publications {
4533
maven(MavenPublication) {
4634

build.gradle

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,13 @@ buildscript {
88
}
99

1010
plugins {
11-
id 'com.github.spotbugs' version '6.1.3'
11+
id 'com.github.spotbugs' version '6.1.7'
12+
id 'io.github.gradle-nexus.publish-plugin' version '2.0.0'
13+
1214
}
1315

16+
apply plugin: 'io.github.gradle-nexus.publish-plugin'
17+
1418
// We require building with JDK 17 or later. Built artifact compatibility
1519
// is controlled by javaLanguageVersion
1620
assert JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_17)
@@ -23,7 +27,7 @@ allprojects {
2327
repositories {
2428
mavenCentral()
2529
maven {
26-
url = 'https://oss.sonatype.org/content/repositories/snapshots'
30+
url = 'https://central.sonatype.com/repository/maven-snapshots/'
2731
}
2832
}
2933

@@ -90,3 +94,15 @@ subprojects {
9094
options.compilerArgs << "-Xlint:deprecation" << '-Xlint:unchecked'
9195
}
9296
}
97+
98+
nexusPublishing {
99+
repositories {
100+
sonatype {
101+
nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/"))
102+
snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/"))
103+
// We must defensively check for these properties so CI builds work
104+
username.set(project.hasProperty('sonatypeUsername') ? sonatypeUsername : 'unknown')
105+
password.set(project.hasProperty('sonatypePassword') ? sonatypePassword : 'unknown')
106+
}
107+
}
108+
}

settings.gradle

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
pluginManagement {
2+
repositories {
3+
gradlePluginPortal()
4+
}
5+
}
6+
17
rootProject.name = 'AutoComplete'
28

39
include 'AutoComplete', 'AutoCompleteDemo'

0 commit comments

Comments
 (0)