@@ -19,7 +19,6 @@ val reactorTestVersion = "3.7.9"
1919val ktorVersion = " 2.3.13"
2020val jsonPathVersion = " 2.9.0"
2121
22- val mavenRepoBaseUrl = " https://oss.sonatype.org"
2322val mainClassKt = " no.nav.security.mock.oauth2.StandaloneMockOAuth2ServerKt"
2423
2524plugins {
@@ -31,11 +30,9 @@ plugins {
3130 id(" com.google.cloud.tools.jib" ) version " 3.4.5"
3231 id(" com.github.johnrengelman.shadow" ) version " 8.1.1"
3332 id(" net.researchgate.release" ) version " 3.1.0"
34- id(" io.github.gradle-nexus .publish-plugin " ) version " 2.0 .0"
33+ id(" com.vanniktech.maven .publish" ) version " 0.34 .0"
3534 id(" org.jetbrains.dokka" ) version " 2.0.0"
3635 `java- library`
37- `maven- publish`
38- signing
3936}
4037
4138application {
@@ -151,62 +148,37 @@ configurations {
151148 }
152149}
153150
154- nexusPublishing {
155- packageGroup.set(" no.nav" )
156- clientTimeout.set(Duration .ofMinutes(2 ))
157- repositories {
158- sonatype {
159- username.set(System .getenv(" SONATYPE_USERNAME" ))
160- password.set(System .getenv(" SONATYPE_PASSWORD" ))
151+ mavenPublishing {
152+ publishToMavenCentral()
153+ signAllPublications()
154+ coordinates(group.toString(), rootProject.name, version.toString())
155+
156+ pom {
157+ name.set(rootProject.name)
158+ description.set(" A simple mock oauth2 server based on OkHttp MockWebServer" )
159+ url.set(" https://github.com/navikt/${rootProject.name} " )
160+ licenses {
161+ license {
162+ name.set(" MIT License" )
163+ url.set(" https://opensource.org/licenses/MIT" )
164+ distribution.set(" https://opensource.org/licenses/MIT" )
165+ }
166+ }
167+ developers {
168+ developer {
169+ organization.set(" Nav (Arbeids- og velferdsdirektoratet) - The Norwegian Labour and Welfare Administration" )
170+ organizationUrl.set(" https://www.nav.no" )
171+ }
172+ }
173+ scm {
174+ connection.set(" scm:git:git://github.com/navikt/${rootProject.name} .git" )
175+ developerConnection.set(" scm:git:ssh://github.com/navikt/${rootProject.name} .git" )
176+ url.set(" https://github.com/navikt/${rootProject.name} " )
161177 }
162- }
163-
164- transitionCheckOptions {
165- maxRetries.set(60 )
166- delayBetween.set(Duration .ofMillis(10000 ))
167178 }
168179}
169180
170181publishing {
171- publications {
172- create<MavenPublication >(" mavenJava" ) {
173- artifactId = rootProject.name
174- from(components[" java" ])
175-
176- versionMapping {
177- usage(" java-api" ) {
178- fromResolutionOf(" runtimeClasspath" )
179- }
180-
181- usage(" java-runtime" ) {
182- fromResolutionResult()
183- }
184- }
185- pom {
186- name.set(rootProject.name)
187- description.set(" A simple mock oauth2 server based on OkHttp MockWebServer" )
188- url.set(" https://github.com/navikt/${rootProject.name} " )
189-
190- licenses {
191- license {
192- name.set(" MIT License" )
193- url.set(" https://opensource.org/licenses/MIT" )
194- }
195- }
196- developers {
197- developer {
198- organization.set(" NAV (Arbeids- og velferdsdirektoratet) - The Norwegian Labour and Welfare Administration" )
199- organizationUrl.set(" https://www.nav.no" )
200- }
201- }
202- scm {
203- connection.set(" scm:git:git://github.com/navikt/${rootProject.name} .git" )
204- developerConnection.set(" scm:git:ssh://github.com/navikt/${rootProject.name} .git" )
205- url.set(" https://github.com/navikt/${rootProject.name} " )
206- }
207- }
208- }
209- }
210182 repositories {
211183 maven {
212184 name = " GitHubPackages"
@@ -219,15 +191,6 @@ publishing {
219191 }
220192}
221193
222- ext[" signing.gnupg.keyName" ] = System .getenv(" GPG_KEY_NAME" )
223- ext[" signing.gnupg.passphrase" ] = System .getenv(" GPG_PASSPHRASE" )
224- ext[" signing.gnupg.executable" ] = " gpg"
225-
226- signing {
227- useGpgCmd()
228- sign(publishing.publications[" mavenJava" ])
229- }
230-
231194tasks.javadoc {
232195 if (JavaVersion .current().isJava9Compatible) {
233196 (options as StandardJavadocDocletOptions ).addBooleanOption(" html5" , true )
@@ -277,12 +240,6 @@ tasks.named("dependencyUpdates", DependencyUpdatesTask::class.java).configure {
277240 }
278241}
279242
280- tasks.named(" useLatestVersions" , se.patrikerdes.UseLatestVersionsTask ::class .java).configure {
281- updateBlacklist = listOf (
282- " io.codearte:nexus-staging"
283- )
284- }
285-
286243// This task is added by Gradle when we use java.withJavadocJar()
287244tasks.named<Jar >(" javadocJar" ) {
288245 from(tasks.named(" dokkaJavadoc" ))
0 commit comments