Package org.owasp.dependencycheck.maven
Class AggregateMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.owasp.dependencycheck.maven.BaseDependencyCheckMojo
-
- org.owasp.dependencycheck.maven.AggregateMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo,org.apache.maven.reporting.MavenReport
@Mojo(name="aggregate", defaultPhase=VERIFY, aggregator=true, threadSafe=true, requiresDependencyResolution=COMPILE_PLUS_RUNTIME, requiresOnline=true) public class AggregateMojo extends BaseDependencyCheckMojoMaven Plugin that checks project dependencies and the dependencies of all child modules to see if they have any known published vulnerabilities.- Author:
- Jeremy Long
-
-
Field Summary
-
Fields inherited from class org.owasp.dependencycheck.maven.BaseDependencyCheckMojo
PROTOCOL_HTTP, PROTOCOL_HTTPS
-
-
Constructor Summary
Constructors Constructor Description AggregateMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanGenerateReport()protected java.util.Set<org.apache.maven.project.MavenProject>getDescendants(org.apache.maven.project.MavenProject project)Returns a set containing all the descendant projects of the given project.java.lang.StringgetDescription(java.util.Locale locale)Gets the description of the Dependency-Check report to be displayed in the Maven Generated Reports page.java.lang.StringgetName(java.util.Locale locale)Returns the report name.protected booleanisConfiguredToSkip(org.apache.maven.project.MavenProject mavenProject)Checks the ODC configuration in the child project to see if should be skipped.protected booleanisMultiModule(org.apache.maven.project.MavenProject mavenProject)Test if the project has pom packagingprotected ExceptionCollectionscanDependencies(Engine engine)Scans the dependencies of the projects in aggregate.protected ExceptionCollectionscanPlugins(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
-
scanDependencies
protected ExceptionCollection scanDependencies(Engine engine) throws org.apache.maven.plugin.MojoExecutionException
Scans the dependencies of the projects in aggregate.- Specified by:
scanDependenciesin 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:
scanPluginsin 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
-
getDescendants
protected java.util.Set<org.apache.maven.project.MavenProject> getDescendants(org.apache.maven.project.MavenProject project)
Returns a set containing all the descendant projects of the given project.- Parameters:
project- the project for which all descendants will be returned- Returns:
- the set of descendant projects
-
isConfiguredToSkip
protected boolean isConfiguredToSkip(org.apache.maven.project.MavenProject mavenProject)
Checks the ODC configuration in the child project to see if should be skipped.- Parameters:
mavenProject- the maven project to check- Returns:
trueif the project is configured to skip ODC; otherwisefalse
-
isMultiModule
protected boolean isMultiModule(org.apache.maven.project.MavenProject mavenProject)
Test if the project has pom packaging- Parameters:
mavenProject- Project to test- Returns:
trueif it has a pom packaging; otherwisefalse
-
canGenerateReport
public boolean canGenerateReport()
-
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
-
-