I would like my Gradle build script to add the complete Classpath to the manifest file contained in JAR file created after the build.
Example:
Manife
I managed to create a custom Jar file with its own manifest file like so:
task createJar(type : Jar) {
manifest {
attributes(
'Manifest-Version': "1.0",
'Main-Class': "org.springframework.boot.loader.JarLauncher",
'Start-Class': "com.my.app.AppApplication",
'Spring-Boot-Version': "2.2.4.RELEASE",
'Spring-Boot-Classes': "BOOT-INF/classes/",
'Spring-Boot-Lib': "BOOT-INF/lib/"
)
}
def originDir = file("${buildDir}/unpacked")
def destinationFile = "${buildDir}/repackaged/${project.name}-${version}"
entryCompression ZipEntryCompression.STORED // no compression in case there are files in BOOT-INF/lib
archiveName destinationFile
from originDir
archiveFile
}