diff --git a/src/main/java/org/owasp/dependencycheck/Engine.java b/src/main/java/org/owasp/dependencycheck/Engine.java index b1413b1ce..0e7de2034 100644 --- a/src/main/java/org/owasp/dependencycheck/Engine.java +++ b/src/main/java/org/owasp/dependencycheck/Engine.java @@ -209,10 +209,16 @@ public class Engine { final List analyzerList = analyzers.get(phase); for (Analyzer a : analyzerList) { - for (Dependency d : dependencies) { + Iterator itrDependencies = dependencies.iterator(); + while (itrDependencies.hasNext()) { + Dependency d = itrDependencies.next(); if (a.supportsExtension(d.getFileExtension())) { try { a.analyze(d, this); + //the following is mainly to deal with the DependencyBundlingAnalyzer + if (a.getPostAnalysisAction() == Analyzer.PostAnalysisAction.REMOVE_JAR) { + itrDependencies.remove(); + } } catch (AnalysisException ex) { d.addAnalysisException(ex); }