Class NexusAnalyzer
java.lang.Object
org.owasp.dependencycheck.analyzer.AbstractAnalyzer
org.owasp.dependencycheck.analyzer.AbstractFileTypeAnalyzer
org.owasp.dependencycheck.analyzer.NexusAnalyzer
- All Implemented Interfaces:
FileFilter, Analyzer, FileTypeAnalyzer
Analyzer which will attempt to locate a dependency on a Nexus service by
SHA-1 digest of the dependency.
There are two settings which govern this behavior:
Settings.KEYS.ANALYZER_NEXUS_ENABLEDdetermines whether this analyzer is even enabled. This can be overridden by setting the system property.Settings.KEYS.ANALYZER_NEXUS_URLthe URL to a Nexus service to search by SHA-1. There is an expected%sin this where the SHA-1 will get entered.
- Author:
- colezlaw
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe default URL - this will be used by the CentralAnalyzer to determine whether to enable this. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidanalyzeDependency(Dependency dependency, Engine engine) Performs the analysis.Returns the analysis phase under which the analyzer runs.protected StringReturns the key used in the properties file to reference the analyzer's enabled property.protected FileFilterReturns the FileFiltergetName()Returns the analyzer's name.voidinitialize(Settings settings) Initializes the analyzer with the configured settings.booleanDetermine whether to enable this analyzer or not.voidprepareFileTypeAnalyzer(Engine engine) Initializes the analyzer once before any analysis is performed.booleanuseProxy()Determine if a proxy should be used for the Nexus Analyzer.Methods inherited from class AbstractFileTypeAnalyzer
accept, getFilesMatched, newHashSet, prepareAnalyzer, setFilesMatchedMethods inherited from class AbstractAnalyzer
analyze, close, closeAnalyzer, getSettings, prepare, setEnabled, supportsParallelProcessingMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Analyzer
analyze, close, prepare, supportsParallelProcessing
-
Field Details
-
DEFAULT_URL
The default URL - this will be used by the CentralAnalyzer to determine whether to enable this.- See Also:
-
-
Constructor Details
-
NexusAnalyzer
public NexusAnalyzer()
-
-
Method Details
-
initialize
Initializes the analyzer with the configured settings.- Specified by:
initializein interfaceAnalyzer- Overrides:
initializein classAbstractAnalyzer- Parameters:
settings- the configured settings to use
-
isEnabled
public boolean isEnabled()Determine whether to enable this analyzer or not.- Specified by:
isEnabledin interfaceAnalyzer- Overrides:
isEnabledin classAbstractAnalyzer- Returns:
- whether the analyzer should be enabled
-
prepareFileTypeAnalyzer
Initializes the analyzer once before any analysis is performed.- Specified by:
prepareFileTypeAnalyzerin classAbstractFileTypeAnalyzer- Parameters:
engine- a reference to the dependency-check engine- Throws:
InitializationException- if there's an error during initialization
-
getName
-
getAnalyzerEnabledSettingKey
Returns the key used in the properties file to reference the analyzer's enabled property.- Specified by:
getAnalyzerEnabledSettingKeyin classAbstractAnalyzer- Returns:
- the analyzer's enabled property setting key
-
getAnalysisPhase
Returns the analysis phase under which the analyzer runs.- Returns:
- the phase under which this analyzer runs
-
getFileFilter
Returns the FileFilter- Specified by:
getFileFilterin classAbstractFileTypeAnalyzer- Returns:
- the FileFilter
-
analyzeDependency
Performs the analysis.- Specified by:
analyzeDependencyin classAbstractAnalyzer- Parameters:
dependency- the dependency to analyzeengine- the engine- Throws:
AnalysisException- when there's an exception during analysis
-
useProxy
public boolean useProxy()Determine if a proxy should be used for the Nexus Analyzer.- Returns:
trueif a proxy should be used
-