@@ -84,43 +84,24 @@ publishing {
84
84
// fleshes out problems with Maven pom generation when building
85
85
tasks. build. dependsOn(" publishJavaLibraryPublicationToMavenLocal" )
86
86
87
- // Bintray Gradle plugin configuration (https://github.com/bintray/gradle-bintray-plugin)
88
- // Plugin jars are added to the buildscript classpath in the root build.gradle file
89
- apply plugin : " com.jfrog.bintray"
90
-
91
- bintray {
92
- // We need to use some user id here, because the Bintray key is associated with the user
93
- // However, any user id is good, so longer the user has necessary privileges to the repository
94
- user = ' szczepiq' // https://bintray.com/szczepiq
95
- key = System . getenv(' BINTRAY_API_KEY' )
96
- publish = true // can be changed to 'false' for testing
97
- dryRun = project. hasProperty(" bintrayDryRun" )
98
-
99
- // allow override in order to possibility re-run job if something failed
100
- // especially Maven Central sync
101
- // https://github.com/mockito/mockito-testng/issues/26
102
- override = true
103
-
104
- publications = [' javaLibrary' ]
105
-
106
- pkg {
107
- repo = ' maven' // https://bintray.com/mockito/maven
108
- userOrg = ' mockito' // https://bintray.com/mockito
109
-
110
- name = " mockito-testng"
111
-
112
- licenses = [' MIT' ]
113
- labels = [' testng' , ' mockito' ]
114
- vcsUrl = " https://github.com/mockito/mockito-testng.git"
87
+ apply plugin : ' signing' // https://docs.gradle.org/current/userguide/signing_plugin.html
88
+ signing {
89
+ if (System . getenv(' PGP_KEY' )) {
90
+ useInMemoryPgpKeys(System . getenv(' PGP_KEY' ), System . getenv(' PGP_PWD' ))
91
+ sign publishing. publications. javaLibrary
92
+ }
93
+ }
115
94
116
- version {
117
- name = project. version
118
- vcsTag = " v$project . version "
95
+ apply plugin : ' io.github.gradle-nexus.publish-plugin'
96
+ nexusPublishing {
97
+ repositories {
98
+ if (System . getenv(' NEXUS_TOKEN_PWD' )) {
99
+ sonatype {
100
+ // Publishing to: https://s01.oss.sonatype.org (faster instance)
101
+ nexusUrl = uri(' https://s01.oss.sonatype.org/service/local/' )
102
+ snapshotRepositoryUrl = uri(' https://s01.oss.sonatype.org/content/repositories/snapshots/' )
119
103
120
- // Notable versions are automatically synced to Maven Central repository (https://oss.sonatype.org/)
121
- mavenCentralSync {
122
- sync = true
123
- user = System . getenv(' NEXUS_TOKEN_USER' )
104
+ username = System . getenv(' NEXUS_TOKEN_USER' )
124
105
password = System . getenv(' NEXUS_TOKEN_PWD' )
125
106
}
126
107
}
0 commit comments