Class 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 CycloneDxMojo
    Creates 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 Detail

      • excludeArtifactId

        @Parameter(property="excludeArtifactId",
                   required=false)
        protected String[] excludeArtifactId
        Excluded reactor project (aka module) ArtifactIds from aggregate BOM.
        Since:
        2.4.0
      • excludeGroupId

        @Parameter(property="excludeGroupId",
                   required=false)
        protected String[] excludeGroupId
        Excluded reactor project (aka module) GroupIds from aggregate BOM.
        Since:
        2.7.3
      • excludeTestProject

        @Parameter(property="excludeTestProject",
                   defaultValue="false",
                   required=false)
        protected Boolean excludeTestProject
        Should reactor project (aka module) artifactId with the word "test" be excluded from aggregate BOM?
        Since:
        2.4.0
    • Constructor Detail

      • CycloneDxAggregateMojo

        public CycloneDxAggregateMojo()
    • Method Detail

      • shouldExclude

        protected boolean shouldExclude​(org.apache.maven.project.MavenProject mavenProject)
      • 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: BaseCycloneDxMojo
        Analyze the current Maven project to extract the BOM components list and their dependencies.
        Overrides:
        extractComponentsAndDependencies in class CycloneDxMojo
        Parameters:
        topLevelComponents - the PURLs for all top level components
        components - the components map to fill
        dependencies - the dependencies map to fill
        Returns:
        the name of the analysis done to store as a BOM, or null to not save result.
        Throws:
        org.apache.maven.plugin.MojoExecutionException - something weird happened...