From 3a698abf4538654d31f9d7492ee00d3acbcc398d Mon Sep 17 00:00:00 2001 From: Jeremy Long Date: Fri, 24 Jan 2014 18:50:32 -0500 Subject: [PATCH] added nexus configuration options Former-commit-id: effe33b77171c4ecc312ca08ef25dd5ae667f81a --- .../taskdefs/DependencyCheckTask.java | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/dependency-check-ant/src/main/java/org/owasp/dependencycheck/taskdefs/DependencyCheckTask.java b/dependency-check-ant/src/main/java/org/owasp/dependencycheck/taskdefs/DependencyCheckTask.java index d694b8440..640c76704 100644 --- a/dependency-check-ant/src/main/java/org/owasp/dependencycheck/taskdefs/DependencyCheckTask.java +++ b/dependency-check-ant/src/main/java/org/owasp/dependencycheck/taskdefs/DependencyCheckTask.java @@ -457,6 +457,52 @@ public class DependencyCheckTask extends Task { this.showSummary = showSummary; } + /** + * Whether or not the nexus analyzer is enabled. + */ + private boolean nexusAnalyzerEnabled = true; + + /** + * Get the value of nexusAnalyzerEnabled. + * + * @return the value of nexusAnalyzerEnabled + */ + public boolean isNexusAnalyzerEnabled() { + return nexusAnalyzerEnabled; + } + + /** + * Set the value of nexusAnalyzerEnabled. + * + * @param nexusAnalyzerEnabled new value of nexusAnalyzerEnabled + */ + public void setNexusAnalyzerEnabled(boolean nexusAnalyzerEnabled) { + this.nexusAnalyzerEnabled = nexusAnalyzerEnabled; + } + + /** + * The URL of the Nexus server. + */ + private String nexusUrl; + + /** + * Get the value of nexusUrl. + * + * @return the value of NexusUrl + */ + public String getNexusUrl() { + return nexusUrl; + } + + /** + * Set the value of nexusUrl. + * + * @param NexusUrl new value of NexusUrl + */ + public void setNexusUrl(String NexusUrl) { + this.nexusUrl = NexusUrl; + } + @Override public void execute() throws BuildException { final InputStream in = DependencyCheckTask.class.getClassLoader().getResourceAsStream(LOG_PROPERTIES_FILE); @@ -574,6 +620,10 @@ public class DependencyCheckTask extends Task { if (suppressionFile != null && !suppressionFile.isEmpty()) { Settings.setString(Settings.KEYS.SUPPRESSION_FILE, suppressionFile); } + Settings.setBoolean(Settings.KEYS.ANALYZER_NEXUS_ENABLED, nexusAnalyzerEnabled); + if (nexusUrl != null && !nexusUrl.isEmpty()) { + Settings.setString(Settings.KEYS.ANALYZER_NEXUS_URL, nexusUrl); + } } /**