Package org.cyclonedx.maven
Class CycloneDxAggregateMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.cyclonedx.maven.BaseCycloneDxMojo
-
- org.cyclonedx.maven.CycloneDxMojo
-
- org.cyclonedx.maven.CycloneDxAggregateMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(name="makeAggregateBom", defaultPhase=PACKAGE, threadSafe=true, aggregator=true, requiresOnline=true) public class CycloneDxAggregateMojo extends CycloneDxMojoCreates a CycloneDX aggregate BOM at build root (with dependencies from the whole multi-modules build), and eventually a BOM for each module.- Since:
- 2.1.0
-
-
Field Summary
Fields Modifier and Type Field Description protected String[]excludeArtifactIdExcluded reactor project (aka module) ArtifactIds from aggregate BOM.protected String[]excludeGroupIdExcluded reactor project (aka module) GroupIds from aggregate BOM.protected BooleanexcludeTestProjectShould reactor project (aka module) artifactId with the word "test" be excluded from aggregate BOM?-
Fields inherited from class org.cyclonedx.maven.CycloneDxMojo
dependencyAnalyzer
-
Fields inherited from class org.cyclonedx.maven.BaseCycloneDxMojo
detectUnusedForOptionalScope, MESSAGE_ATTACHING_BOM, MESSAGE_CREATING_BOM, MESSAGE_RESOLVING_AGGREGATED_DEPS, MESSAGE_RESOLVING_DEPS, MESSAGE_VALIDATION_FAILURE, MESSAGE_WRITING_BOM
-
-
Constructor Summary
Constructors Constructor Description CycloneDxAggregateMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringextractComponentsAndDependencies(Set<String> topLevelComponents, Map<String,org.cyclonedx.model.Component> components, Map<String,org.cyclonedx.model.Dependency> dependencies)Analyze the current Maven project to extract the BOM components list and their dependencies.protected voidlogAdditionalParameters()protected booleanshouldExclude(org.apache.maven.project.MavenProject mavenProject)-
Methods inherited from class org.cyclonedx.maven.CycloneDxMojo
doProjectDependencyAnalysis
-
Methods inherited from class org.cyclonedx.maven.BaseCycloneDxMojo
convert, execute, extractBOMDependencies, generatePackageUrl, getProject, logParameters, populateComponents, schemaVersion
-
-
-
-
Field Detail
-
excludeArtifactId
@Parameter(property="excludeArtifactId", required=false) protected String[] excludeArtifactIdExcluded reactor project (aka module) ArtifactIds from aggregate BOM.- Since:
- 2.4.0
-
excludeGroupId
@Parameter(property="excludeGroupId", required=false) protected String[] excludeGroupIdExcluded reactor project (aka module) GroupIds from aggregate BOM.- Since:
- 2.7.3
-
excludeTestProject
@Parameter(property="excludeTestProject", defaultValue="false", required=false) protected Boolean excludeTestProjectShould reactor project (aka module) artifactId with the word "test" be excluded from aggregate BOM?- Since:
- 2.4.0
-
-
Method Detail
-
shouldExclude
protected boolean shouldExclude(org.apache.maven.project.MavenProject mavenProject)
-
logAdditionalParameters
protected void logAdditionalParameters()
- Overrides:
logAdditionalParametersin classBaseCycloneDxMojo
-
extractComponentsAndDependencies
protected String extractComponentsAndDependencies(Set<String> topLevelComponents, Map<String,org.cyclonedx.model.Component> components, Map<String,org.cyclonedx.model.Dependency> dependencies) throws org.apache.maven.plugin.MojoExecutionException
Description copied from class:BaseCycloneDxMojoAnalyze the current Maven project to extract the BOM components list and their dependencies.- Overrides:
extractComponentsAndDependenciesin classCycloneDxMojo- Parameters:
topLevelComponents- the PURLs for all top level componentscomponents- the components map to filldependencies- the dependencies map to fill- Returns:
- the name of the analysis done to store as a BOM, or
nullto not save result. - Throws:
org.apache.maven.plugin.MojoExecutionException- something weird happened...
-
-