mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-03-18 23:34:15 +01:00
exposing the hints file to the CLI with new option "--hints"
This commit is contained in:
@@ -347,6 +347,7 @@ public class App {
|
|||||||
final String dataDirectory = cli.getDataDirectory();
|
final String dataDirectory = cli.getDataDirectory();
|
||||||
final File propertiesFile = cli.getPropertiesFile();
|
final File propertiesFile = cli.getPropertiesFile();
|
||||||
final String suppressionFile = cli.getSuppressionFile();
|
final String suppressionFile = cli.getSuppressionFile();
|
||||||
|
final String hintsFile = cli.getHintsFile();
|
||||||
final String nexusUrl = cli.getNexusUrl();
|
final String nexusUrl = cli.getNexusUrl();
|
||||||
final String databaseDriverName = cli.getDatabaseDriverName();
|
final String databaseDriverName = cli.getDatabaseDriverName();
|
||||||
final String databaseDriverPath = cli.getDatabaseDriverPath();
|
final String databaseDriverPath = cli.getDatabaseDriverPath();
|
||||||
@@ -394,6 +395,7 @@ public class App {
|
|||||||
Settings.setStringIfNotEmpty(Settings.KEYS.PROXY_PASSWORD, proxyPass);
|
Settings.setStringIfNotEmpty(Settings.KEYS.PROXY_PASSWORD, proxyPass);
|
||||||
Settings.setStringIfNotEmpty(Settings.KEYS.CONNECTION_TIMEOUT, connectionTimeout);
|
Settings.setStringIfNotEmpty(Settings.KEYS.CONNECTION_TIMEOUT, connectionTimeout);
|
||||||
Settings.setStringIfNotEmpty(Settings.KEYS.SUPPRESSION_FILE, suppressionFile);
|
Settings.setStringIfNotEmpty(Settings.KEYS.SUPPRESSION_FILE, suppressionFile);
|
||||||
|
Settings.setStringIfNotEmpty(Settings.KEYS.HINTS_FILE, hintsFile);
|
||||||
Settings.setIntIfNotNull(Settings.KEYS.CVE_CHECK_VALID_FOR_HOURS, cveValidForHours);
|
Settings.setIntIfNotNull(Settings.KEYS.CVE_CHECK_VALID_FOR_HOURS, cveValidForHours);
|
||||||
|
|
||||||
//File Type Analyzer Settings
|
//File Type Analyzer Settings
|
||||||
|
|||||||
@@ -277,6 +277,10 @@ public final class CliParser {
|
|||||||
.desc("The file path to the suppression XML file.")
|
.desc("The file path to the suppression XML file.")
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
final Option hintsFile = Option.builder().argName("file").hasArg().longOpt(ARGUMENT.HINTS_FILE)
|
||||||
|
.desc("The file path to the hints XML file.")
|
||||||
|
.build();
|
||||||
|
|
||||||
final Option cveValidForHours = Option.builder().argName("hours").hasArg().longOpt(ARGUMENT.CVE_VALID_FOR_HOURS)
|
final Option cveValidForHours = Option.builder().argName("hours").hasArg().longOpt(ARGUMENT.CVE_VALID_FOR_HOURS)
|
||||||
.desc("The number of hours to wait before checking for new updates from the NVD.")
|
.desc("The number of hours to wait before checking for new updates from the NVD.")
|
||||||
.build();
|
.build();
|
||||||
@@ -305,6 +309,7 @@ public final class CliParser {
|
|||||||
.addOption(props)
|
.addOption(props)
|
||||||
.addOption(verboseLog)
|
.addOption(verboseLog)
|
||||||
.addOption(suppressionFile)
|
.addOption(suppressionFile)
|
||||||
|
.addOption(hintsFile)
|
||||||
.addOption(cveValidForHours)
|
.addOption(cveValidForHours)
|
||||||
.addOption(experimentalEnabled);
|
.addOption(experimentalEnabled);
|
||||||
}
|
}
|
||||||
@@ -962,6 +967,15 @@ public final class CliParser {
|
|||||||
return line.getOptionValue(ARGUMENT.SUPPRESSION_FILE);
|
return line.getOptionValue(ARGUMENT.SUPPRESSION_FILE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the path to the hints file.
|
||||||
|
*
|
||||||
|
* @return the path to the hints file
|
||||||
|
*/
|
||||||
|
public String getHintsFile() {
|
||||||
|
return line.getOptionValue(ARGUMENT.HINTS_FILE);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* Prints the manifest information to standard output.</p>
|
* Prints the manifest information to standard output.</p>
|
||||||
@@ -1273,9 +1287,14 @@ public final class CliParser {
|
|||||||
*/
|
*/
|
||||||
public static final String SUPPRESSION_FILE = "suppression";
|
public static final String SUPPRESSION_FILE = "suppression";
|
||||||
/**
|
/**
|
||||||
* The CLI argument name for setting the location of the suppression
|
* The CLI argument name for setting the location of the hint
|
||||||
* file.
|
* file.
|
||||||
*/
|
*/
|
||||||
|
public static final String HINTS_FILE = "hints";
|
||||||
|
/**
|
||||||
|
* The CLI argument name for setting the number of hours to wait before
|
||||||
|
* checking for new updates from the NVD.
|
||||||
|
*/
|
||||||
public static final String CVE_VALID_FOR_HOURS = "cveValidForHours";
|
public static final String CVE_VALID_FOR_HOURS = "cveValidForHours";
|
||||||
/**
|
/**
|
||||||
* Disables the Jar Analyzer.
|
* Disables the Jar Analyzer.
|
||||||
|
|||||||
Reference in New Issue
Block a user