From c54483d36f2168c67f1f537ec6e50cf5d19cad11 Mon Sep 17 00:00:00 2001 From: Steve Springett Date: Wed, 26 Nov 2014 15:03:10 +0200 Subject: [PATCH] Adding missing central analyzer config to scan agent Former-commit-id: 948e67459ba06c7a4f76efaba16d0dfbbba1aa44 --- .../agent/DependencyCheckScanAgent.java | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/dependency-check-core/src/main/java/org/owasp/dependencycheck/agent/DependencyCheckScanAgent.java b/dependency-check-core/src/main/java/org/owasp/dependencycheck/agent/DependencyCheckScanAgent.java index 6fa41e556..f88483487 100644 --- a/dependency-check-core/src/main/java/org/owasp/dependencycheck/agent/DependencyCheckScanAgent.java +++ b/dependency-check-core/src/main/java/org/owasp/dependencycheck/agent/DependencyCheckScanAgent.java @@ -440,6 +440,52 @@ public class DependencyCheckScanAgent { this.showSummary = showSummary; } + /** + * Whether or not the Maven Central analyzer is enabled. + */ + private boolean centralAnalyzerEnabled = true; + + /** + * Get the value of centralAnalyzerEnabled. + * + * @return the value of centralAnalyzerEnabled + */ + public boolean isCentralAnalyzerEnabled() { + return centralAnalyzerEnabled; + } + + /** + * Set the value of centralAnalyzerEnabled. + * + * @param centralAnalyzerEnabled new value of centralAnalyzerEnabled + */ + public void setCentralAnalyzerEnabled(boolean centralAnalyzerEnabled) { + this.centralAnalyzerEnabled = centralAnalyzerEnabled; + } + + /** + * The URL of Maven Central. + */ + private String centralUrl; + + /** + * Get the value of centralUrl. + * + * @return the value of centralUrl + */ + public String getCentralUrl() { + return centralUrl; + } + + /** + * Set the value of centralUrl. + * + * @param centralUrl new value of centralUrl + */ + public void setCentralUrl(String centralUrl) { + this.centralUrl = centralUrl; + } + /** * Whether or not the nexus analyzer is enabled. */ @@ -849,6 +895,10 @@ public class DependencyCheckScanAgent { if (suppressionFile != null && !suppressionFile.isEmpty()) { Settings.setString(Settings.KEYS.SUPPRESSION_FILE, suppressionFile); } + Settings.setBoolean(Settings.KEYS.ANALYZER_CENTRAL_ENABLED, centralAnalyzerEnabled); + if (centralUrl != null && !centralUrl.isEmpty()) { + Settings.setString(Settings.KEYS.ANALYZER_CENTRAL_URL, centralUrl); + } Settings.setBoolean(Settings.KEYS.ANALYZER_NEXUS_ENABLED, nexusAnalyzerEnabled); if (nexusUrl != null && !nexusUrl.isEmpty()) { Settings.setString(Settings.KEYS.ANALYZER_NEXUS_URL, nexusUrl);