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
This commit is contained in:
gewuyou 2025-06-04 10:52:33 +08:00
parent 2753c27dca
commit 446b859a8a

View File

@ -41,7 +41,6 @@ version = scmVersion.version
// 配置目录路径 // 配置目录路径
val configDir = "$rootDir/config/" val configDir = "$rootDir/config/"
val tasksDir = "$configDir/tasks/"
// 全局项目配置 // 全局项目配置
allprojects { allprojects {
@ -189,7 +188,14 @@ subprojects {
languageVersion.set(JavaLanguageVersion.of(21)) languageVersion.set(JavaLanguageVersion.of(21))
} }
} }
tasks.named<Jar>("jar") {
manifest {
attributes(
"Implementation-Title" to project.name,
"Implementation-Version" to project.version
)
}
}
// 任务配置 // 任务配置
tasks.withType<Jar> { tasks.withType<Jar> {
isEnabled = true isEnabled = true