Skip to content

Commit b7d0409

Browse files
committed
Update to gradle-nexus publish-plugin (#520)
- remove "artifacts" and add "artifact" to have javadoc and sources build - invoke `./gradlew publishToMavenLocal`: build and sign artifacts and put these into local maven repository - invoke `./gradlew publishToSonatype` to build, sign and upload artifacts to sonatype
1 parent 585c22c commit b7d0409

File tree

1 file changed

+6
-30
lines changed

1 file changed

+6
-30
lines changed

build.gradle

Lines changed: 6 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ plugins {
2020
id 'org.ajoberstar.grgit' version '2.3.0'
2121
//id 'org.ec4j.editorconfig' version '0.0.3'
2222
id 'org.sonarqube' version '2.6.2'
23-
id 'io.codearte.nexus-staging' version '0.30.0'
23+
id 'io.github.gradle-nexus.publish-plugin' version '1.3.0'
2424
}
2525

2626
subprojects {
@@ -128,11 +128,6 @@ subprojects {
128128
}
129129
}
130130

131-
artifacts {
132-
archives sourceJar
133-
archives javadocJar
134-
}
135-
136131
checkstyle {
137132
toolVersion '8.30'
138133
checkstyleTest.enabled = false
@@ -216,6 +211,8 @@ subprojects {
216211
url = 'https://github.com/metafacture/metafacture-core/actions'
217212
}
218213
}
214+
artifact(sourceJar)
215+
artifact(javadocJar)
219216
}
220217
}
221218
}
@@ -237,15 +234,6 @@ subprojects {
237234
}
238235
}
239236
}
240-
else if (project.hasProperty('snapshotRepositoryUrl')) {
241-
maven {
242-
url = snapshotRepositoryUrl
243-
credentials {
244-
username = snapshotRepositoryUser
245-
password = snapshotRepositoryPassword
246-
}
247-
}
248-
}
249237
}
250238
}
251239

@@ -268,24 +256,12 @@ sonarqube {
268256
}
269257
}
270258

271-
nexusStaging {
272-
if (project.hasProperty('stagingServerUrl')) {
273-
serverUrl = stagingServerUrl
274-
}
275-
if (project.hasProperty('releaseRepositoryUser')) {
276-
username = releaseRepositoryUser
277-
password = releaseRepositoryPassword
259+
nexusPublishing {
260+
repositories {
261+
sonatype ()
278262
}
279263
}
280264

281-
tasks.closeRepository.onlyIf {
282-
rootProject.scmInfo.isRelease()
283-
}
284-
285-
tasks.releaseRepository.onlyIf {
286-
rootProject.scmInfo.isRelease()
287-
}
288-
289265
class ScmInfo {
290266
def version
291267
def tag

0 commit comments

Comments
 (0)