From 3ef7de3998181fbb2fdf90329c766ea56146e759 Mon Sep 17 00:00:00 2001 From: Rahul Krishna Date: Sat, 13 Apr 2024 10:51:27 -0400 Subject: [PATCH] Collect and include files from compile classpath, excluding signature-related files Signed-off-by: Rahul Krishna --- build.gradle | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 262b0702..724f5bfe 100644 --- a/build.gradle +++ b/build.gradle @@ -127,7 +127,21 @@ task fatjar(type: Jar) { 'Implementation-Version': archiveVersion, 'Main-Class': 'com.ibm.northstar.CodeAnalyzer' } - from { configurations.compileClasspath.collect { it.isDirectory() ? it : zipTree(it) } } + // Collect and include files from compile classpath, excluding signature-related files + from (configurations.runtimeClasspath) { + exclude 'META-INF/*.SF' + exclude 'META-INF/*.DSA' + exclude 'META-INF/*.RSA' + exclude 'META-INF/MANIFEST.MF' + // Use zipTree to process JAR files + eachFile { details -> + if (details.file.isFile() && details.name.endsWith('.jar')) { + zipTree(details.file) + } else { + details.file + } + } + } with jar }