added option to change the name of the report per issue #389

This commit is contained in:
Jeremy Long
2015-10-20 06:18:28 -04:00
parent fccba5f7fd
commit c2e6065ed7
3 changed files with 22 additions and 5 deletions

View File

@@ -29,6 +29,7 @@ import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.plugins.annotations.ResolutionScope;
import org.apache.maven.project.MavenProject;
import org.owasp.dependencycheck.analyzer.DependencyBundlingAnalyzer;
@@ -261,6 +262,13 @@ public class AggregateMojo extends BaseDependencyCheckMojo {
return true; //aggregate always returns true for now - we can look at a more complicated/acurate solution later
}
/**
* The name of the report in the site.
*/
@SuppressWarnings("CanBeFinal")
@Parameter(property = "name", defaultValue = "dependency-check:aggregate", required = true)
private String name = "dependency-check:aggregate";
/**
* Returns the report name.
*
@@ -269,7 +277,7 @@ public class AggregateMojo extends BaseDependencyCheckMojo {
*/
@Override
public String getName(Locale locale) {
return "dependency-check:aggregate";
return name;
}
/**

View File

@@ -23,6 +23,7 @@ import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.plugins.annotations.ResolutionScope;
import org.owasp.dependencycheck.data.nvdcve.DatabaseException;
import org.owasp.dependencycheck.utils.Settings;
@@ -89,6 +90,13 @@ public class CheckMojo extends BaseDependencyCheckMojo {
Settings.cleanup();
}
/**
* The name of the report in the site.
*/
@SuppressWarnings("CanBeFinal")
@Parameter(property = "name", defaultValue = "dependency-check", required = true)
private String name = "dependency-check";
/**
* Returns the report name.
*
@@ -97,7 +105,7 @@ public class CheckMojo extends BaseDependencyCheckMojo {
*/
@Override
public String getName(Locale locale) {
return "dependency-check";
return name;
}
/**

View File

@@ -14,15 +14,16 @@ The following properties can be set on the dependency-check-maven plugin.
Property | Description | Default Value
---------------------|------------------------------------|------------------
aggregate | Deprecated - use the aggregate goal instead. |  
autoUpdate | Sets whether auto-updating of the NVD CVE/CPE data is enabled. It is not recommended that this be turned to false. | true
outputDirectory | The location to write the report(s). Note, this is not used if generating the report as part of a `mvn site` build | 'target'
failBuildOnCVSS | Specifies if the build should be failed if a CVSS score above a specified level is identified. The default is 11 which means since the CVSS scores are 0-10, by default the build will never fail. | 11
format | The report format to be generated (HTML, XML, VULN, ALL). This configuration option has no affect if using this within the Site plugin unless the externalReport is set to true. | HTML
name | The name of the report in the site | dependency-check or dependency-check:aggregate
suppressionFile | The file path to the XML suppression file \- used to suppress [false positives](../general/suppression.html) |  
skipTestScope | Should be skip analysis for artifacts with Test Scope | true
skip | Skips the dependency-check analysis | false
skipTestScope | Should be skip analysis for artifacts with Test Scope | true
skipProvidedScope | Should be skip analysis for artifacts with Provided Scope | false
skipRuntimeScope | Should be skip analysis for artifacts with Runtime Scope | false
skipRuntimeScope | Should be skip analysis for artifacts with Runtime Scope | false
Analyzer Configuration
====================