From bc1f85865c2d71cbeafaf29cc091425bddaddd5c Mon Sep 17 00:00:00 2001 From: Jim Martens Date: Tue, 15 Aug 2023 09:28:18 +0200 Subject: [PATCH] Enable bootJar --- .../main/kotlin/twomartens.java.gradle.kts | 18 ---------- .../kotlin/twomartens.spring-boot.gradle.kts | 35 +++++++++---------- module-server/server.gradle.kts | 2 +- 3 files changed, 17 insertions(+), 38 deletions(-) diff --git a/buildSrc/src/main/kotlin/twomartens.java.gradle.kts b/buildSrc/src/main/kotlin/twomartens.java.gradle.kts index 7361281..09bed28 100644 --- a/buildSrc/src/main/kotlin/twomartens.java.gradle.kts +++ b/buildSrc/src/main/kotlin/twomartens.java.gradle.kts @@ -1,6 +1,4 @@ import org.gradle.accessors.dm.LibrariesForLibs -import java.time.ZonedDateTime -import java.time.format.DateTimeFormatter plugins { jacoco @@ -51,22 +49,6 @@ tasks.jacocoTestReport { } } -val formatter: DateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSZ") - -tasks.jar { - doFirst { - manifest { - attributes["Implementation-Title"] = rootProject.name - attributes["Implementation-Version"] = archiveVersion.get() - attributes["Implementation-Vendor"] = "Jim Martens" - attributes["Build-Timestamp"] = ZonedDateTime.now().format(formatter) - attributes["Created-By"] = "Gradle ${gradle.gradleVersion}" - attributes["Build-Jdk"] = "${providers.systemProperty("java.version").get()} (${providers.systemProperty("java.vendor").get()} ${providers.systemProperty("java.vm.version").get()})" - attributes["Build-OS"] = "${providers.systemProperty("os.name").get()} ${providers.systemProperty("os.arch").get()} ${providers.systemProperty("os.version").get()}" - } - } -} - normalization.runtimeClasspath.metaInf { ignoreAttribute("Build-Timestamp") } diff --git a/buildSrc/src/main/kotlin/twomartens.spring-boot.gradle.kts b/buildSrc/src/main/kotlin/twomartens.spring-boot.gradle.kts index f4d6b00..1745162 100644 --- a/buildSrc/src/main/kotlin/twomartens.spring-boot.gradle.kts +++ b/buildSrc/src/main/kotlin/twomartens.spring-boot.gradle.kts @@ -1,4 +1,7 @@ import org.gradle.accessors.dm.LibrariesForLibs +import java.time.ZonedDateTime +import java.time.format.DateTimeFormatter +import java.time.format.DateTimeFormatter.ofPattern plugins { id("org.springframework.boot") @@ -57,27 +60,21 @@ tasks.named("buildAll") { dependsOn("integrationTest") } -springBoot { - buildInfo() -} +val formatter: DateTimeFormatter = ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSZ") tasks.bootJar { - enabled = false + manifest { + attributes["Implementation-Title"] = rootProject.name + attributes["Implementation-Version"] = archiveVersion.get() + attributes["Implementation-Vendor"] = "Jim Martens" + attributes["Build-Timestamp"] = ZonedDateTime.now().format(formatter) + attributes["Created-By"] = "Gradle ${gradle.gradleVersion}" + attributes["Build-Jdk"] = "${providers.systemProperty("java.version").get()} (${providers.systemProperty("java.vendor").get()} ${providers.systemProperty("java.vm.version").get()})" + attributes["Build-OS"] = "${providers.systemProperty("os.name").get()} ${providers.systemProperty("os.arch").get()} ${providers.systemProperty("os.version").get()}" + } } -tasks.jar { - enabled = true - archiveClassifier.set("") +springBoot { + buildInfo() + mainClass.set("de.twomartens.wahlrecht.MainApplicationKt") } - -tasks.bootDistZip { - dependsOn(tasks.jar) -} - -tasks.bootDistTar { - dependsOn(tasks.jar) -} - -tasks.bootStartScripts { - dependsOn(tasks.jar) -} \ No newline at end of file diff --git a/module-server/server.gradle.kts b/module-server/server.gradle.kts index 0aecaac..ecef5d7 100644 --- a/module-server/server.gradle.kts +++ b/module-server/server.gradle.kts @@ -10,4 +10,4 @@ dependencies { annotationProcessor(libs.mapstruct.processor) kapt(libs.mapstruct.processor) implementation(libs.spring.cloud.starter.config) -} \ No newline at end of file +}