Package org.owasp.dependencycheck.maven
Class CheckMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.owasp.dependencycheck.maven.BaseDependencyCheckMojo
-
- org.owasp.dependencycheck.maven.CheckMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
,org.apache.maven.reporting.MavenReport
@Mojo(name="check", defaultPhase=VERIFY, threadSafe=true, requiresDependencyResolution=COMPILE_PLUS_RUNTIME, requiresOnline=true) public class CheckMojo extends BaseDependencyCheckMojo
Maven Plugin that checks the project dependencies to see if they have any known published vulnerabilities.- Author:
- Jeremy Long
-
-
Constructor Summary
Constructors Constructor Description CheckMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canGenerateReport()
Returns whether or not a the report can be generated.java.lang.String
getDescription(java.util.Locale locale)
Gets the description of the Dependency-Check report to be displayed in the Maven Generated Reports page.java.lang.String
getName(java.util.Locale locale)
Returns the report name.protected ExceptionCollection
scanDependencies(Engine engine)
Scans the dependencies of the project.protected ExceptionCollection
scanPlugins(Engine engine, ExceptionCollection exCollection)
Scans the plugins of the project.-
Methods inherited from class org.owasp.dependencycheck.maven.BaseDependencyCheckMojo
checkForFailure, createProjectReferenceName, execute, generate, getArtifactScopeExcluded, getCategoryName, getConnectionString, getCorrectOutputDirectory, getCorrectOutputDirectory, getExcludes, getOutputDirectory, getOutputName, getProject, getReactorProjects, getReportOutputDirectory, getSettings, initializeEngine, isExternalReport, isFailOnError, isGeneratingSite, newResolveArtifactProjectBuildingRequest, populateSettings, resolveArtifactDependencies, runCheck, scanArtifacts, scanArtifacts, scanPlugins, setReportOutputDirectory, showSummary
-
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
-
-
-
Method Detail
-
canGenerateReport
public boolean canGenerateReport()
Returns whether or not a the report can be generated.- Returns:
true
if the report can be generated; otherwisefalse
-
getName
public java.lang.String getName(java.util.Locale locale)
Returns the report name.- Parameters:
locale
- the location- Returns:
- the report name
-
getDescription
public java.lang.String getDescription(java.util.Locale locale)
Gets the description of the Dependency-Check report to be displayed in the Maven Generated Reports page.- Parameters:
locale
- The Locale to get the description for- Returns:
- the description
-
scanDependencies
protected ExceptionCollection scanDependencies(Engine engine) throws org.apache.maven.plugin.MojoExecutionException
Scans the dependencies of the project.- Specified by:
scanDependencies
in classBaseDependencyCheckMojo
- Parameters:
engine
- the engine used to perform the scanning- Returns:
- a collection of exceptions
- Throws:
org.apache.maven.plugin.MojoExecutionException
- thrown if a fatal exception occurs
-
scanPlugins
protected ExceptionCollection scanPlugins(Engine engine, ExceptionCollection exCollection) throws org.apache.maven.plugin.MojoExecutionException
Scans the plugins of the project.- Specified by:
scanPlugins
in classBaseDependencyCheckMojo
- Parameters:
engine
- the engine used to perform the scanningexCollection
- the collection of exceptions that might have occurred previously- Returns:
- a collection of exceptions
- Throws:
org.apache.maven.plugin.MojoExecutionException
- thrown if a fatal exception occurs
-
-