I need to add the following headers to the MANIFEST.MF file using Gradle and Spring Boot:
- Name
- Specification-Title
- Specification-Version
- Specification-Vendor
Is there a way to configure the Gradle build process to read these values from settings.gradle and build.gradle and write them to the MANIFEST.MF file?
Writing them to the manifest file is described here: add manifest file to jar with gradle
To populate these values from
settings.gradleandgradle.properties, consider the following:build.gradle
settings.gradle
gradle.properties
The result from
./gradlew clean buildgivesbuild/libs/tmp.jarcontaining this manifest:MANIFEST.MF
If you need to do this for the
bootJar, usebootJar {instead ofjar {in yourbuild.gradle.