From 231dde7d14443a3b422a4337502c20deaca2f528 Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Fri, 27 Dec 2024 17:49:59 +0100 Subject: [PATCH] Fix startup failures in polaris-service distributions (#593) --- dropwizard/service/build.gradle.kts | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/dropwizard/service/build.gradle.kts b/dropwizard/service/build.gradle.kts index c209ca998..294279946 100644 --- a/dropwizard/service/build.gradle.kts +++ b/dropwizard/service/build.gradle.kts @@ -168,20 +168,19 @@ tasks.register("testJar") { val shadowJar = tasks.named("shadowJar") { append("META-INF/hk2-locator/default") - finalizedBy("startScripts") + finalizedBy("startShadowScripts") } val startScripts = - tasks.named("startScripts") { - classpath = files(provider { shadowJar.get().archiveFileName }) - applicationName = "polaris-service" - } + tasks.named("startScripts") { applicationName = "polaris-service" } + +tasks.named("startShadowScripts") { applicationName = "polaris-service" } tasks.register("prepareDockerDist") { into(project.layout.buildDirectory.dir("docker-dist")) from(startScripts) { into("bin") } - from(shadowJar) { into("lib") } - doFirst { delete(project.layout.buildDirectory.dir("regtest-dist")) } + from(configurations.runtimeClasspath) { into("lib") } + from(tasks.named("jar")) { into("lib") } } tasks.named("build").configure { dependsOn("prepareDockerDist") } @@ -193,6 +192,12 @@ distributions { from("../../LICENSE-BINARY-DIST").rename("LICENSE-BINARY-DIST", "LICENSE") } } + named("shadow") { + contents { + from("../../NOTICE") + from("../../LICENSE-BINARY-DIST").rename("LICENSE-BINARY-DIST", "LICENSE") + } + } } tasks.named("assemble").configure { dependsOn("testJar") }