mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-01-14 07:43:40 +01:00
finished deprecating the application name argument in favor of project name per issue #320
This commit is contained in:
@@ -145,13 +145,15 @@ public class DependencyCheckTask extends Task {
|
||||
/**
|
||||
* The application name for the report.
|
||||
*/
|
||||
private String applicationName = "Dependency-Check";
|
||||
@Deprecated
|
||||
private String applicationName = null;
|
||||
|
||||
/**
|
||||
* Get the value of applicationName.
|
||||
*
|
||||
* @return the value of applicationName
|
||||
*/
|
||||
@Deprecated
|
||||
public String getApplicationName() {
|
||||
return applicationName;
|
||||
}
|
||||
@@ -161,9 +163,37 @@ public class DependencyCheckTask extends Task {
|
||||
*
|
||||
* @param applicationName new value of applicationName
|
||||
*/
|
||||
@Deprecated
|
||||
public void setApplicationName(String applicationName) {
|
||||
this.applicationName = applicationName;
|
||||
}
|
||||
|
||||
private String projectName = "Dependency-Check";
|
||||
|
||||
/**
|
||||
* Get the value of projectName.
|
||||
*
|
||||
* @return the value of projectName
|
||||
*/
|
||||
public String getProjectName() {
|
||||
if (applicationName != null) {
|
||||
log("Configuration 'applicationName' has been deprecated, please use 'projectName' instead", Project.MSG_WARN);
|
||||
if ("Dependency-Check".equals(projectName)) {
|
||||
projectName = applicationName;
|
||||
}
|
||||
}
|
||||
return projectName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the value of projectName.
|
||||
*
|
||||
* @param projectName new value of projectName
|
||||
*/
|
||||
public void setProjectName(String projectName) {
|
||||
this.projectName = projectName;
|
||||
}
|
||||
|
||||
/**
|
||||
* The location of the data directory that contains
|
||||
*/
|
||||
@@ -279,8 +309,7 @@ public class DependencyCheckTask extends Task {
|
||||
}
|
||||
|
||||
/**
|
||||
* 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. Default is HTML.
|
||||
* The report format to be generated (HTML, XML, VULN, ALL). Default is HTML.
|
||||
*/
|
||||
private String reportFormat = "HTML";
|
||||
|
||||
@@ -933,7 +962,7 @@ public class DependencyCheckTask extends Task {
|
||||
cve.close();
|
||||
}
|
||||
}
|
||||
final ReportGenerator reporter = new ReportGenerator(applicationName, engine.getDependencies(), engine.getAnalyzers(), prop);
|
||||
final ReportGenerator reporter = new ReportGenerator(getProjectName(), engine.getDependencies(), engine.getAnalyzers(), prop);
|
||||
reporter.generateReports(reportOutputDirectory, reportFormat);
|
||||
|
||||
if (this.failBuildOnCVSS <= 10) {
|
||||
|
||||
@@ -8,7 +8,7 @@ the project's dependencies.
|
||||
|
||||
```xml
|
||||
<target name="dependency-check" description="Dependency-Check Analysis">
|
||||
<dependency-check applicationname="Hello World"
|
||||
<dependency-check projectname="Hello World"
|
||||
reportoutputdirectory="${basedir}"
|
||||
reportformat="ALL">
|
||||
|
||||
@@ -27,7 +27,7 @@ Property | Description | Default Value
|
||||
----------------------|------------------------------------|------------------
|
||||
autoUpdate | Sets whether auto-updating of the NVD CVE/CPE data is enabled. It is not recommended that this be turned to false. | true
|
||||
updateOnly | If set to true only the update phase of dependency-check will be executed; no scan will be executed and no report will be generated. | false
|
||||
externalReport | When using as a Site plugin this parameter sets whether or not the external report format should be used. | false
|
||||
projectName | The name of the project being scanned. | Dependency-Check
|
||||
reportOutputDirectory | 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
|
||||
reportFormat | 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
|
||||
|
||||
@@ -5,7 +5,7 @@ The following table lists the command line arguments:
|
||||
|
||||
Short | Argument Name | Parameter | Description | Requirement
|
||||
-------|-----------------------|-----------------|-------------|------------
|
||||
\-a | \-\-app | \<name\> | The name of the application being scanned. This is a required argument. | Required
|
||||
| \-\-project | \<name\> | The name of the project being scanned. | Required
|
||||
\-s | \-\-scan | \<path\> | The path to scan \- this option can be specified multiple times. It is also possible to specify Ant style paths (e.g. directory/**/*.jar). | Required
|
||||
| \-\-exclude | \<pattern\> | The path patterns to exclude from the scan \- this option can be specified multiple times. This accepts Ant style path patterns (e.g. **/exclude/**). | Optional
|
||||
| \-\-symLink | \<depth\> | The depth that symbolic links will be followed; the default is 0 meaning symbolic links will not be followed. | Optional
|
||||
|
||||
Reference in New Issue
Block a user