Skip to content

Commit a9f313a

Browse files
fix: classloading problem with fat jars (#7786)
1 parent 326eb6b commit a9f313a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

core/src/main/java/org/owasp/dependencycheck/analyzer/AbstractSuppressionAnalyzer.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,10 @@ private void loadPackagedSuppressionBaseData(final SuppressionParser parser, fin
200200
String suppressionFileLocation = jarLocation.getFile();
201201
if (suppressionFileLocation.endsWith(".jar")) {
202202
suppressionFileLocation = "jar:file:" + suppressionFileLocation + "!/" + BASE_SUPPRESSION_FILE;
203+
} else if (suppressionFileLocation.startsWith("nested:") && suppressionFileLocation.endsWith(".jar!/")) {
204+
// suppressionFileLocation -> nested:/app/app.jar/!BOOT-INF/lib/dependency-check-core-<version>.jar!/
205+
// goal-> jar:nested:/app/app.jar/!BOOT-INF/lib/dependency-check-core-<version>.jar!/dependencycheck-base-suppression.xml
206+
suppressionFileLocation = "jar:" + suppressionFileLocation + BASE_SUPPRESSION_FILE;
203207
} else {
204208
suppressionFileLocation = "file:" + suppressionFileLocation + BASE_SUPPRESSION_FILE;
205209
}

0 commit comments

Comments
 (0)