From 446b859a8ae666f627d0a7bd674178849b898047 Mon Sep 17 00:00:00 2001 From: gewuyou Date: Wed, 4 Jun 2025 10:52:33 +0800 Subject: [PATCH] build: ADD PROJECT INFORMATION TO THE MANIFEST FOR THE JAR PACKAGE. MF- Add task configuration in build.gradle.kts, MANIFEST generated for jar package. Add the project name and version information to the MF file - New attributes: - Implementation-Title: The name of the project - Implementation-Version: The version of the project --- build.gradle.kts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 54b0baa..fac9dba 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -41,7 +41,6 @@ version = scmVersion.version // 配置目录路径 val configDir = "$rootDir/config/" -val tasksDir = "$configDir/tasks/" // 全局项目配置 allprojects { @@ -189,7 +188,14 @@ subprojects { languageVersion.set(JavaLanguageVersion.of(21)) } } - + tasks.named("jar") { + manifest { + attributes( + "Implementation-Title" to project.name, + "Implementation-Version" to project.version + ) + } + } // 任务配置 tasks.withType { isEnabled = true