From babe4739c55039a46b0092d9ac05bf609e957500 Mon Sep 17 00:00:00 2001 From: Ahmet Kiyak Date: Tue, 17 Feb 2015 18:57:24 +0100 Subject: [PATCH] Removes the test for default Maven repository directory. Error: If the M3_REPO directory is not set to a path that contains */m2/repository/* the DependencyCheck doesn't read .pom file. Some dependencies like "spring-core-3.2.0.RELEASE.jar" are not found due to this error. Fix: Remove the test for default Maven repository directory. The existing check for the existence of .pom file is sufficient. Former-commit-id: 8d7c51f611b5d26d505cfc3fe9f8b94c12174000 --- .../dependencycheck/analyzer/JarAnalyzer.java | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/dependency-check-core/src/main/java/org/owasp/dependencycheck/analyzer/JarAnalyzer.java b/dependency-check-core/src/main/java/org/owasp/dependencycheck/analyzer/JarAnalyzer.java index c7fc30a0d..715e6cc1d 100644 --- a/dependency-check-core/src/main/java/org/owasp/dependencycheck/analyzer/JarAnalyzer.java +++ b/dependency-check-core/src/main/java/org/owasp/dependencycheck/analyzer/JarAnalyzer.java @@ -295,15 +295,11 @@ public class JarAnalyzer extends AbstractFileTypeAnalyzer { } File externalPom = null; if (pomEntries.isEmpty()) { - if (dependency.getActualFilePath().matches(".*\\.m2.repository\\b.*")) { - String pomPath = dependency.getActualFilePath(); - pomPath = pomPath.substring(0, pomPath.lastIndexOf('.')) + ".pom"; - externalPom = new File(pomPath); - if (externalPom.isFile()) { - pomEntries.add(pomPath); - } else { - return false; - } + String pomPath = dependency.getActualFilePath(); + pomPath = pomPath.substring(0, pomPath.lastIndexOf('.')) + ".pom"; + externalPom = new File(pomPath); + if (externalPom.isFile()) { + pomEntries.add(pomPath); } else { return false; }