mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-03-21 00:29:21 +01:00
added the ability to disable the Central Analyzer (issue #175)
Former-commit-id: f154f7ab2eec81a90290ee38cb2ecb823f056216
This commit is contained in:
@@ -233,6 +233,7 @@ public class App {
|
|||||||
final boolean archiveDisabled = cli.isArchiveDisabled();
|
final boolean archiveDisabled = cli.isArchiveDisabled();
|
||||||
final boolean assemblyDisabled = cli.isAssemblyDisabled();
|
final boolean assemblyDisabled = cli.isAssemblyDisabled();
|
||||||
final boolean nuspecDisabled = cli.isNuspecDisabled();
|
final boolean nuspecDisabled = cli.isNuspecDisabled();
|
||||||
|
final boolean centralDisabled = cli.isCentralDisabled();
|
||||||
final boolean nexusDisabled = cli.isNexusDisabled();
|
final boolean nexusDisabled = cli.isNexusDisabled();
|
||||||
final String nexusUrl = cli.getNexusUrl();
|
final String nexusUrl = cli.getNexusUrl();
|
||||||
final String databaseDriverName = cli.getDatabaseDriverName();
|
final String databaseDriverName = cli.getDatabaseDriverName();
|
||||||
@@ -298,6 +299,7 @@ public class App {
|
|||||||
Settings.setBoolean(Settings.KEYS.ANALYZER_NUSPEC_ENABLED, !nuspecDisabled);
|
Settings.setBoolean(Settings.KEYS.ANALYZER_NUSPEC_ENABLED, !nuspecDisabled);
|
||||||
Settings.setBoolean(Settings.KEYS.ANALYZER_ASSEMBLY_ENABLED, !assemblyDisabled);
|
Settings.setBoolean(Settings.KEYS.ANALYZER_ASSEMBLY_ENABLED, !assemblyDisabled);
|
||||||
|
|
||||||
|
Settings.setBoolean(Settings.KEYS.ANALYZER_CENTRAL_ENABLED, !centralDisabled);
|
||||||
Settings.setBoolean(Settings.KEYS.ANALYZER_NEXUS_ENABLED, !nexusDisabled);
|
Settings.setBoolean(Settings.KEYS.ANALYZER_NEXUS_ENABLED, !nexusDisabled);
|
||||||
if (nexusUrl != null && !nexusUrl.isEmpty()) {
|
if (nexusUrl != null && !nexusUrl.isEmpty()) {
|
||||||
Settings.setString(Settings.KEYS.ANALYZER_NEXUS_URL, nexusUrl);
|
Settings.setString(Settings.KEYS.ANALYZER_NEXUS_URL, nexusUrl);
|
||||||
|
|||||||
@@ -323,6 +323,10 @@ public final class CliParser {
|
|||||||
.withDescription("Disable the .NET Assembly Analyzer.")
|
.withDescription("Disable the .NET Assembly Analyzer.")
|
||||||
.create();
|
.create();
|
||||||
|
|
||||||
|
final Option disableCentralAnalyzer = OptionBuilder.withLongOpt(ARGUMENT.DISABLE_CENTRAL)
|
||||||
|
.withDescription("Disable the Central Analyzer. If this analyzer is disabled it is likely you also want to disable the Nexus Analyzer.")
|
||||||
|
.create();
|
||||||
|
|
||||||
final Option disableNexusAnalyzer = OptionBuilder.withLongOpt(ARGUMENT.DISABLE_NEXUS)
|
final Option disableNexusAnalyzer = OptionBuilder.withLongOpt(ARGUMENT.DISABLE_NEXUS)
|
||||||
.withDescription("Disable the Nexus Analyzer.")
|
.withDescription("Disable the Nexus Analyzer.")
|
||||||
.create();
|
.create();
|
||||||
@@ -360,6 +364,7 @@ public final class CliParser {
|
|||||||
.addOption(disableArchiveAnalyzer)
|
.addOption(disableArchiveAnalyzer)
|
||||||
.addOption(disableAssemblyAnalyzer)
|
.addOption(disableAssemblyAnalyzer)
|
||||||
.addOption(disableNuspecAnalyzer)
|
.addOption(disableNuspecAnalyzer)
|
||||||
|
.addOption(disableCentralAnalyzer)
|
||||||
.addOption(disableNexusAnalyzer)
|
.addOption(disableNexusAnalyzer)
|
||||||
.addOption(nexusUrl)
|
.addOption(nexusUrl)
|
||||||
.addOption(nexusUsesProxy)
|
.addOption(nexusUsesProxy)
|
||||||
@@ -456,6 +461,15 @@ public final class CliParser {
|
|||||||
return (line != null) && line.hasOption(ARGUMENT.DISABLE_NEXUS);
|
return (line != null) && line.hasOption(ARGUMENT.DISABLE_NEXUS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if the disableCentral command line argument was specified.
|
||||||
|
*
|
||||||
|
* @return true if the disableCentral command line argument was specified; otherwise false
|
||||||
|
*/
|
||||||
|
public boolean isCentralDisabled() {
|
||||||
|
return (line != null) && line.hasOption(ARGUMENT.DISABLE_CENTRAL);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the url to the nexus server if one was specified.
|
* Returns the url to the nexus server if one was specified.
|
||||||
*
|
*
|
||||||
@@ -876,6 +890,10 @@ public final class CliParser {
|
|||||||
* Disables the Nuspec Analyzer.
|
* Disables the Nuspec Analyzer.
|
||||||
*/
|
*/
|
||||||
public static final String DISABLE_NUSPEC = "disableNuspec";
|
public static final String DISABLE_NUSPEC = "disableNuspec";
|
||||||
|
/**
|
||||||
|
* Disables the Central Analyzer.
|
||||||
|
*/
|
||||||
|
public static final String DISABLE_CENTRAL = "disableCentral";
|
||||||
/**
|
/**
|
||||||
* Disables the Nexus Analyzer.
|
* Disables the Nexus Analyzer.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user