@@ -5,7 +5,8 @@ plugins {
55 id(" com.github.johnrengelman.shadow" )
66 id(" biz.aQute.bnd.builder" )
77 id(" maven-publish" )
8- id(" com.jfrog.bintray" )
8+ id(" io.github.gradle-nexus.publish-plugin" )
9+ id(" signing" )
910 id(" com.github.breadmoirai.github-release" )
1011 id(" com.github.hierynomus.license" )
1112 id(" pmd" )
@@ -271,44 +272,29 @@ allprojects {
271272
272273 plugins.apply (" com.jfrog.bintray" )
273274
274- bintray {
275- user = " ${rootProject.extra[" bintray_username" ]} "
276- key = " ${rootProject.extra[" bintray_apiKey" ]} "
277- publish = true
278- pkg.apply {
279- userOrg = " hivemq"
280- repo = " HiveMQ"
281- name = " hivemq-mqtt-client"
282- desc = project.description
283- websiteUrl = metadata.url.get()
284- issueTrackerUrl = metadata.issueManagement!! .url.get()
285- vcsUrl = metadata.scm!! .url.get()
286- setLicenses(metadata.license!! .shortName.get())
287- setLabels(" mqtt" , " mqtt-client" , " iot" , " internet-of-things" , " rxjava2" , " reactive-streams" , " backpressure" )
288- version.apply {
289- released = Date ().toString()
290- vcsTag = " v${project.version} "
291- gpg.apply {
292- sign = true
275+ afterEvaluate {
276+ publishing {
277+ publications {
278+ create<MavenPublication >(" sonatype" ) {
279+ from(components[" java" ]);
293280 }
294281 }
295282 }
296- }
297- afterEvaluate {
298- bintray.setPublications(* publishing.publications.withType<MavenPublication >().names.toTypedArray())
299- }
300283
301- // workaround for publishing gradle module metadata https://github.com/bintray/gradle-bintray-plugin/issues/229
302- tasks.withType< com.jfrog.bintray.gradle.tasks.BintrayUploadTask > {
303- doFirst {
304- publishing.publications.withType<MavenPublication > {
305- val moduleFile = buildDir.resolve(" publications/$name /module.json" )
306- if (moduleFile.exists()) {
307- artifact(moduleFile).extension = " module"
308- }
309- }
284+ signing {
285+ val signingKey = " ${project.findProperty(" signingKey" )} "
286+ val signingPassword = " ${project.findProperty(" signingPassword" )} "
287+ useInMemoryPgpKeys(signingKey, signingPassword)
288+ sign(publishing.publications[" sonatype" ])
310289 }
311290 }
291+
292+ }
293+ }
294+
295+ nexusPublishing {
296+ repositories {
297+ sonatype()
312298 }
313299}
314300
0 commit comments