@@ -56,9 +56,8 @@ allJavaProjects.addAll(sampleAppProjects);
5656configure(webAuthn4JSpringSecurityLibraryProjects) {
5757 apply plugin : ' java-library'
5858 apply plugin : ' jacoco'
59+ apply plugin : ' signing'
5960 apply plugin : " maven-publish"
60- apply plugin : ' com.jfrog.bintray'
61- apply plugin : " com.jfrog.artifactory"
6261
6362 javadoc {
6463 options. charSet = ' UTF-8'
@@ -89,6 +88,10 @@ configure(webAuthn4JSpringSecurityLibraryProjects) {
8988 apply from : " $rootDir /helper.gradle" ;
9089
9190 def githubUrl = " https://github.com/webauthn4j/webauthn4j-spring-security"
91+ def mavenCentralUser = getVariable(' MAVEN_CENTRAL_USER' , ' mavenCentralUser' )
92+ def mavenCentralPassword = getVariable(' MAVEN_CENTRAL_PASSWORD' , ' mavenCentralPassword' )
93+ def pgpSigningKey = getVariable(' PGP_SIGNING_KEY' , ' pgpSigningKey' )
94+ def pgpSigningKeyPassphrase = getVariable(' PGP_SIGNING_KEY_PASSPHRASE' , ' pgpSigningKeyPassphrase' )
9295
9396 publishing {
9497 publications {
@@ -138,76 +141,36 @@ configure(webAuthn4JSpringSecurityLibraryProjects) {
138141 }
139142 }
140143 }
141- }
142-
143- def bintrayUser = getVariable(' BINTRAY_USER' , ' bintrayUser' )
144- def bintrayToken = getVariable(' BINTRAY_TOKEN' , ' bintrayToken' )
145- def artifactoryUser = getVariable(' ARTIFACTORY_USER' , ' artifactoryUser' )
146- def artifactoryPassword = getVariable(' ARTIFACTORY_PASSWORD' , ' artifactoryPassword' )
147- def mavenCentralUser = getVariable(' MAVEN_CENTRAL_USER' , ' mavenCentralUser' )
148- def mavenCentralPassword = getVariable(' MAVEN_CENTRAL_PASSWORD' , ' mavenCentralPassword' )
149144
150- task bintrayGpgSign(){
151- group = " publishing"
152- doLast{
153- signArtifactsOnBintray(bintrayUser, bintrayToken);
154- }
155- }
156-
157- task bintrayMavenCentralSync(){
158- group = " publishing"
159- doLast{
160- syncMavenCentralToBintray(bintrayUser, bintrayToken);
161- }
162- }
163-
164- artifactory {
165- contextUrl = ' http://oss.jfrog.org/artifactory/simple/'
166- publish {
167- repository {
168- repoKey = ' oss-snapshot-local' // The Artifactory repository key to publish to
169- username = artifactoryUser
170- password = artifactoryPassword
145+ repositories {
146+ maven {
147+ name = " mavenCentral"
148+ url = " https://oss.sonatype.org/service/local/staging/deploy/maven2"
149+ credentials {
150+ username = " ${ mavenCentralUser} "
151+ password = " ${ mavenCentralPassword} "
152+ }
171153 }
172- defaults {
173- publications(' standard' )
154+ maven {
155+ name = " snapshot"
156+ url = " https://oss.sonatype.org/content/repositories/snapshots"
157+ credentials {
158+ username = " ${ mavenCentralUser} "
159+ password = " ${ mavenCentralPassword} "
160+ }
174161 }
175162 }
176163 }
177164
178- artifactoryPublish {
179- skip = ! " ${ webAuthn4JSpringSecurityVersion} " . endsWith(" -SNAPSHOT" ) // Publish only when it is SNAPSHOT release
165+ signing {
166+ useInMemoryPgpKeys(pgpSigningKey, pgpSigningKeyPassphrase)
167+ sign publishing. publications. standard
180168 }
181169
182- bintray {
183- user = bintrayUser
184- key = bintrayToken
185- configurations = [' archives' ]
186- publish = true
187- dryRun = ! (" ${ webAuthn4JSpringSecurityVersion} " . endsWith(" .RELEASE" )) // Publish only when it is RELEASE release
188- publications = [' standard' ]
189- pkg {
190- userOrg = " webauthn4j"
191- repo = " webauthn4j"
192- name = project. name
193- desc = project. description
194- licenses = [' Apache-2.0' ]
195- vcsUrl = githubUrl
196- version {
197- name = " ${ webAuthn4JSpringSecurityVersion} "
198- released = new Date ()
199- vcsTag = " ${ webAuthn4JSpringSecurityVersion} "
200- gpg {
201- sign = true
202- }
203- // Optional configuration for Maven Central sync of the version
204- mavenCentralSync {
205- user = mavenCentralUser
206- password = mavenCentralPassword
207- }
208- }
209- }
210- }
170+ publishStandardPublicationToSnapshotRepository. onlyIf { webauthn4jSpringSecurityVersion. endsWith(" -SNAPSHOT" ) }
171+ publishStandardPublicationToMavenCentralRepository. onlyIf { ! webauthn4jSpringSecurityVersion. endsWith(" -SNAPSHOT" ) }
172+
173+
211174}
212175
213176configure(sampleAppProjects) {
0 commit comments