Source:
public void analyzeFileType(Dependency dependency, Engine engine) throws AnalysisException { if (!isEnabled()) { return; } try { final MavenArtifact ma = searcher.searchSha1(dependency.getSha1sum()); dependency.addAsEvidence("nexus", ma, Confidence.HIGH); boolean pomAnalyzed = false; LOGGER.fine("POM URL " + ma.getPomUrl()); for (Evidence e : dependency.getVendorEvidence()) { if ("pom".equals(e.getSource())) { pomAnalyzed = true; break; } } if (!pomAnalyzed && ma.getPomUrl() != null) { File pomFile = null; try { final File baseDir = Settings.getTempDirectory(); pomFile = File.createTempFile("pom", ".xml", baseDir); if (!pomFile.delete()) { final String msg = String.format("Unable to fetch pom.xml for %s from Central; " + "this could result in undetected CPE/CVEs.", dependency.getFileName()); LOGGER.warning(msg); LOGGER.fine("Unable to delete temp file"); } LOGGER.fine(String.format("Downloading %s", ma.getPomUrl())); Downloader.fetchFile(new URL(ma.getPomUrl()), pomFile); pomUtil.analyzePOM(dependency, pomFile); } catch (DownloadFailedException ex) { final String msg = String.format("Unable to download pom.xml for %s from Central; " + "this could result in undetected CPE/CVEs.", dependency.getFileName()); LOGGER.warning(msg); } finally { if (pomFile != null && !FileUtils.deleteQuietly(pomFile)) { pomFile.deleteOnExit(); } } } } catch (IllegalArgumentException iae) { LOGGER.info(String.format("invalid sha-1 hash on %s", dependency.getFileName())); } catch (FileNotFoundException fnfe) { LOGGER.fine(String.format("Artifact not found in repository '%s'", dependency.getFileName())); LOGGER.log(Level.FINE, fnfe.getMessage(), fnfe); } catch (IOException ioe) { LOGGER.log(Level.FINE, "Could not connect to nexus repository", ioe); } }

Target:
public void analyzeFileType(Dependency dependency, Engine engine) throws AnalysisException { if (!isEnabled()) { return; } try { final MavenArtifact ma = searcher.searchSha1(dependency.getSha1sum()); dependency.addAsEvidence("nexus", ma, Confidence.HIGH); boolean pomAnalyzed = false; LOGGER.fine("POM URL " + ma.getPomUrl()); for (Evidence e : dependency.getVendorEvidence()) { if ("pom".equals(e.getSource())) { pomAnalyzed = true; break; } } if (!pomAnalyzed && ma.getPomUrl() != null) { File pomFile = null; try { final File baseDir = Settings.getTempDirectory(); pomFile = File.createTempFile("pom", ".xml", baseDir); if (!pomFile.delete()) { final String msg = String.format("Unable to fetch pom.xml for %s from Nexus repository; " + "this could result in undetected CPE/CVEs.", dependency.getFileName()); LOGGER.warning(msg); LOGGER.fine("Unable to delete temp file"); } LOGGER.fine(String.format("Downloading %s", ma.getPomUrl())); Downloader.fetchFile(new URL(ma.getPomUrl()), pomFile); pomUtil.analyzePOM(dependency, pomFile); } catch (DownloadFailedException ex) { final String msg = String.format("Unable to download pom.xml for %s from Nexus repository; " + "this could result in undetected CPE/CVEs.", dependency.getFileName()); LOGGER.warning(msg); } finally { if (pomFile != null && !FileUtils.deleteQuietly(pomFile)) { pomFile.deleteOnExit(); } } } } catch (IllegalArgumentException iae) { LOGGER.info(String.format("invalid sha-1 hash on %s", dependency.getFileName())); } catch (FileNotFoundException fnfe) { LOGGER.fine(String.format("Artifact not found in repository '%s'", dependency.getFileName())); LOGGER.log(Level.FINE, fnfe.getMessage(), fnfe); } catch (IOException ioe) { LOGGER.log(Level.FINE, "Could not connect to nexus repository", ioe); } }