Package org.cyclonedx.maven
Class CycloneDxMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.cyclonedx.maven.BaseCycloneDxMojo
-
- org.cyclonedx.maven.CycloneDxMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
CycloneDxAggregateMojo
@Mojo(name="makeBom", defaultPhase=PACKAGE, threadSafe=true, requiresOnline=true) public class CycloneDxMojo extends BaseCycloneDxMojoCreates a CycloneDX BOM for each Maven module with its dependencies.
-
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.maven.shared.dependency.analyzer.ProjectDependencyAnalyzerdependencyAnalyzerMaven ProjectDependencyAnalyzer analyzes a Maven project's declared dependencies and effective classes used to find which artifacts are used and declared, used but not declared, not used but declared.-
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 CycloneDxMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.apache.maven.shared.dependency.analyzer.ProjectDependencyAnalysisdoProjectDependencyAnalysis(org.apache.maven.project.MavenProject mavenProject, ProjectDependenciesConverter.BomDependencies bomDependencies)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.-
Methods inherited from class org.cyclonedx.maven.BaseCycloneDxMojo
convert, execute, extractBOMDependencies, generatePackageUrl, getProject, logAdditionalParameters, logParameters, populateComponents, schemaVersion
-
-
-
-
Field Detail
-
dependencyAnalyzer
protected org.apache.maven.shared.dependency.analyzer.ProjectDependencyAnalyzer dependencyAnalyzer
Maven ProjectDependencyAnalyzer analyzes a Maven project's declared dependencies and effective classes used to find which artifacts are used and declared, used but not declared, not used but declared.
-
-
Method Detail
-
doProjectDependencyAnalysis
protected org.apache.maven.shared.dependency.analyzer.ProjectDependencyAnalysis doProjectDependencyAnalysis(org.apache.maven.project.MavenProject mavenProject, ProjectDependenciesConverter.BomDependencies bomDependencies) throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
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.- Specified by:
extractComponentsAndDependenciesin classBaseCycloneDxMojo- 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...
-
-