From c0da96ebe1e00ccc987131dda2c5ad37e3ded4b1 Mon Sep 17 00:00:00 2001 From: Rahul Krishna Date: Thu, 25 Apr 2024 14:36:52 -0400 Subject: [PATCH] Exclude signature related patterns in built jar Signed-off-by: Rahul Krishna --- build.gradle | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index 262b0702..9642df18 100644 --- a/build.gradle +++ b/build.gradle @@ -118,16 +118,23 @@ dependencies { testImplementation group: 'junit', name: 'junit', version: '4.13.2' } -task fatjar(type: Jar) { +task fatJar(type: Jar) { archiveBaseName = 'codeanalyzer' archiveFileName = 'codeanalyzer.jar' duplicatesStrategy = DuplicatesStrategy.EXCLUDE manifest { - attributes 'Implementation-Title': 'Northstar Codeanalyzer', - 'Implementation-Version': archiveVersion, - 'Main-Class': 'com.ibm.northstar.CodeAnalyzer' + attributes( + 'Implementation-Title': 'Northstar Codeanalyzer', + 'Implementation-Version': project.version, + 'Main-Class': 'com.ibm.northstar.CodeAnalyzer' + ) } - from { configurations.compileClasspath.collect { it.isDirectory() ? it : zipTree(it) } } + + // Collect and include runtime classpath dependencies, excluding signature files + from { + configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } + } + exclude 'META-INF/*.RSA', 'META-INF/*.SF', 'META-INF/*.DSA' with jar }