NoIssue: Support for building runable docker container
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
plugins {
|
||||
id("java")
|
||||
id("application")
|
||||
id("maven-publish")
|
||||
}
|
||||
|
||||
@@ -9,6 +10,10 @@ if (version == "UNSET" && gradle.startParameter.taskNames.any { it.startsWith("p
|
||||
throw GradleException("You must set -Pversion=... (use publish.sh / publishCICD.sh)")
|
||||
}
|
||||
|
||||
application {
|
||||
mainClass.set("com.r35157.nenjim.hubd.impl.ref.Main")
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
|
||||
@@ -28,15 +33,36 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("org.jetbrains:annotations:26.0.1")
|
||||
implementation("log4j:log4j:1.2.17")
|
||||
implementation("com.r35157.nenjim:hubd-api:0.0.0")
|
||||
implementation(platform("org.apache.logging.log4j:log4j-bom:2.25.2"))
|
||||
implementation("org.apache.logging.log4j:log4j-api")
|
||||
runtimeOnly("org.apache.logging.log4j:log4j-core")
|
||||
compileOnly("org.jetbrains:annotations:26.0.2-1")
|
||||
|
||||
implementation("com.r35157.nenjim:hubd-api:0.0-dev")
|
||||
implementation("org.apache.poi:poi-ooxml:5.5.1")
|
||||
}
|
||||
|
||||
java {
|
||||
toolchain { languageVersion.set(JavaLanguageVersion.of(24)) }
|
||||
}
|
||||
|
||||
val dockerLibsDir = layout.buildDirectory.dir("docker/libs")
|
||||
|
||||
tasks.register<Sync>("prepareDockerLibs") {
|
||||
group = "distribution"
|
||||
description = "Copies all runtime dependencies (transitive) to build/docker/libs"
|
||||
|
||||
// Hvis du også vil bygge dit eget jar samtidig, så lad den stå – ellers kan du fjerne den.
|
||||
dependsOn(tasks.named("jar"))
|
||||
|
||||
into(dockerLibsDir)
|
||||
|
||||
// Kun deps (transitivt)
|
||||
from(configurations.runtimeClasspath)
|
||||
|
||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||
}
|
||||
|
||||
tasks.withType<JavaCompile> {
|
||||
options.release.set(24)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user