From df6c998c79102b564607d4baf199b5d79e3dfa95 Mon Sep 17 00:00:00 2001 From: Dag Framstad <15799259+dagframstad@users.noreply.github.com> Date: Thu, 21 Sep 2023 13:22:42 +0200 Subject: [PATCH] github token fra env, repositories i settings.gradle.kts --- async-recievers/build.gradle.kts | 8 -------- build.gradle.kts | 5 +++++ cpa-repo/build.gradle.kts | 23 +++-------------------- ebms-provider/build.gradle.kts | 17 ++--------------- felles/build.gradle.kts | 18 +++--------------- payload-processor/build.gradle.kts | 24 ++++-------------------- settings.gradle.kts | 15 +++++++++++++++ 7 files changed, 32 insertions(+), 78 deletions(-) create mode 100644 build.gradle.kts diff --git a/async-recievers/build.gradle.kts b/async-recievers/build.gradle.kts index d3b4ccc8..1ad7e644 100644 --- a/async-recievers/build.gradle.kts +++ b/async-recievers/build.gradle.kts @@ -11,14 +11,6 @@ plugins { apply(plugin = "io.spring.dependency-management") -repositories { - mavenCentral() -} - -tasks.register("wrapper") { - gradleVersion="8.1.1" -} - dependencies { implementation("org.springframework.boot:spring-boot-starter-web") implementation("org.springframework.kafka:spring-kafka") diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 00000000..d96547af --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,5 @@ +plugins { + kotlin("jvm") version "1.9.0" apply false + kotlin("plugin.serialization") version "1.9.0" apply false + id("io.ktor.plugin") version "2.3.4" apply false +} diff --git a/cpa-repo/build.gradle.kts b/cpa-repo/build.gradle.kts index 3e539bb2..3fb07722 100644 --- a/cpa-repo/build.gradle.kts +++ b/cpa-repo/build.gradle.kts @@ -1,13 +1,12 @@ /* * This file was generated by the Gradle 'init' task. */ -val githubPassword: String by project plugins { - kotlin("jvm") version "1.9.0" + kotlin("jvm") application - id("io.ktor.plugin") version "2.3.4" - kotlin("plugin.serialization") version "1.9.0" + id("io.ktor.plugin") + kotlin("plugin.serialization") } tasks { @@ -18,22 +17,6 @@ tasks { } -repositories { - mavenCentral() - maven { - name = "GitHubPackages" - url = uri("https://maven.pkg.github.com/navikt/ebxml-protokoll") - credentials { - username = "x-access-token" - password = githubPassword - } - } -} - -tasks.register("wrapper") { - gradleVersion="8.1.1" -} - dependencies { implementation(project(":felles")) implementation("io.ktor:ktor-server-core:2.3.4") diff --git a/ebms-provider/build.gradle.kts b/ebms-provider/build.gradle.kts index a64c41d6..48dfb79b 100644 --- a/ebms-provider/build.gradle.kts +++ b/ebms-provider/build.gradle.kts @@ -1,12 +1,11 @@ /* * This file was generated by the Gradle 'init' task. */ -val githubPassword: String by project plugins { - kotlin("jvm") version "1.9.0" + kotlin("jvm") application - id("io.ktor.plugin") version "2.3.4" + id("io.ktor.plugin") } tasks { @@ -15,18 +14,6 @@ tasks { } } -repositories { - mavenCentral() - maven { - name = "GitHubPackages" - url = uri("https://maven.pkg.github.com/navikt/ebxml-protokoll") - credentials { - username = "x-access-token" - password = githubPassword - } - } -} - tasks.register("wrapper") { gradleVersion="8.1.1" } diff --git a/felles/build.gradle.kts b/felles/build.gradle.kts index 17d8e7a4..04ca0a79 100644 --- a/felles/build.gradle.kts +++ b/felles/build.gradle.kts @@ -1,23 +1,10 @@ /* * This file was generated by the Gradle 'init' task. */ -val githubPassword: String by project plugins { - kotlin("jvm") version "1.9.0" - kotlin("plugin.serialization") version "1.9.0" -} - -repositories { - mavenCentral() - maven { - name = "GitHubPackages" - url = uri("https://maven.pkg.github.com/navikt/ebxml-protokoll") - credentials { - username = "x-access-token" - password = githubPassword - } - } + kotlin("jvm") + kotlin("plugin.serialization") } tasks.register("wrapper") { @@ -37,3 +24,4 @@ dependencies { runtimeOnly("org.postgresql:postgresql:42.6.0") } + diff --git a/payload-processor/build.gradle.kts b/payload-processor/build.gradle.kts index 7df3ef44..b8e0e980 100644 --- a/payload-processor/build.gradle.kts +++ b/payload-processor/build.gradle.kts @@ -1,31 +1,15 @@ /* * This file was generated by the Gradle 'init' task. */ -val githubPassword: String by project plugins { - kotlin("jvm") version "1.9.0" - kotlin("plugin.serialization") version "1.9.0" + kotlin("jvm") + kotlin("plugin.serialization") application - id("io.ktor.plugin") version "2.3.4" + id("io.ktor.plugin") } -repositories { - mavenCentral() - maven { - name = "GitHubPackages" - url = uri("https://maven.pkg.github.com/navikt/ebxml-protokoll") - credentials { - username = "x-access-token" - password = githubPassword - } - } -} - - - tasks { - register("wrapper") { gradleVersion="8.1.1" } @@ -66,4 +50,4 @@ kotlin { java { sourceCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17 -} \ No newline at end of file +} diff --git a/settings.gradle.kts b/settings.gradle.kts index 7f690e21..89b3a2bc 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -6,5 +6,20 @@ * Detailed information about configuring a multi-project build in Gradle can be found * in the user manual at https://docs.gradle.org/8.1.1/userguide/multi_project_builds.html */ + +dependencyResolutionManagement { + repositories { + mavenCentral() + maven { + name = "GitHubPackages" + url = uri("https://maven.pkg.github.com/navikt/ebxml-protokoll") + credentials { + username = "token" + password = System.getenv("GITHUB_TOKEN") + } + } + } +} + rootProject.name = "ebxml-processor" include("felles","async-recievers","cpa-repo","ebms-provider", "payload-processor")