Skip to content

Commit 2c0b146

Browse files
committed
ci: prepare for publishing to gpr, add maven central later
1 parent edd6495 commit 2c0b146

File tree

2 files changed

+17
-11
lines changed

2 files changed

+17
-11
lines changed

build.gradle.kts

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ val kotlinVersion = "1.3.61"
1111
val mavenRepoBaseUrl = "https://oss.sonatype.org"
1212
val mainClassKt = "no.nav.security.mock.StandaloneMockOAuth2ServerKt"
1313

14-
group = "no.nav.security"
15-
version = "0.1-SNAPSHOT"
16-
1714
plugins {
1815
application
1916
kotlin("jvm") version "1.3.61"
@@ -61,7 +58,7 @@ dependencies {
6158
publishing {
6259
publications {
6360
create<MavenPublication>("mavenJava") {
64-
artifactId = "mock-oauth2-server"
61+
artifactId = "${rootProject.name}"
6562
from(components["java"])
6663
versionMapping {
6764
usage("java-api") {
@@ -73,9 +70,9 @@ publishing {
7370
}
7471
}
7572
pom {
76-
name.set("mock-oauth2-server")
73+
name.set("${rootProject.name}")
7774
description.set("A simple mock oauth2 server based on OkHttp MockWebServer")
78-
url.set("https://github.com/navikt/mock-oauth2-server")
75+
url.set("https://github.com/navikt/${rootProject.name}")
7976

8077
licenses {
8178
license {
@@ -95,9 +92,9 @@ publishing {
9592
}
9693
}
9794
scm {
98-
connection.set("scm:git:git://github.com/navikt/mock-oauth2-server.git")
99-
developerConnection.set("scm:git:ssh://github.com/navikt/mock-oauth2-server.git")
100-
url.set("https://github.com/navikt/mock-oauth2-server")
95+
connection.set("scm:git:git://github.com/navikt/${rootProject.name}.git")
96+
developerConnection.set("scm:git:ssh://github.com/navikt/${rootProject.name}.git")
97+
url.set("https://github.com/navikt/${rootProject.name}")
10198
}
10299
withXml {
103100
//dependencies.
@@ -114,10 +111,17 @@ publishing {
114111
}
115112
repositories {
116113
maven {
114+
name = "GitHubPackages"
115+
url = uri("https://maven.pkg.github.com/navikt/${rootProject.name}")
116+
credentials {
117+
username = System.getenv("GITHUB_ACTOR")
118+
password = System.getenv("GITHUB_TOKEN")
119+
}
120+
/*
117121
// change URLs to point to your repos, e.g. http://my.org/repo
118122
val releasesRepoUrl = uri("$mavenRepoBaseUrl/service/local/staging/deploy/maven2/")
119123
val snapshotsRepoUrl = uri("$mavenRepoBaseUrl/content/repositories/snapshots")
120-
url = if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl
124+
url = if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl*/
121125
}
122126
}
123127
}

gradle.properties

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
kotlin.code.style=official
1+
kotlin.code.style=official
2+
group=no.nav.security
3+
version=0.1-SNAPSHOT

0 commit comments

Comments
 (0)