Skip to content

Commit

Permalink
Fix startup failures in polaris-service distributions (#593)
Browse files Browse the repository at this point in the history
  • Loading branch information
adutra authored Dec 27, 2024
1 parent 5faadbd commit 231dde7
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions dropwizard/service/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -168,20 +168,19 @@ tasks.register<Jar>("testJar") {
val shadowJar =
tasks.named<ShadowJar>("shadowJar") {
append("META-INF/hk2-locator/default")
finalizedBy("startScripts")
finalizedBy("startShadowScripts")
}

val startScripts =
tasks.named<CreateStartScripts>("startScripts") {
classpath = files(provider { shadowJar.get().archiveFileName })
applicationName = "polaris-service"
}
tasks.named<CreateStartScripts>("startScripts") { applicationName = "polaris-service" }

tasks.named<CreateStartScripts>("startShadowScripts") { applicationName = "polaris-service" }

tasks.register<Sync>("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>("jar")) { into("lib") }
}

tasks.named("build").configure { dependsOn("prepareDockerDist") }
Expand All @@ -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") }

0 comments on commit 231dde7

Please sign in to comment.