Class AbstractBuildinfoMojo

  • All Implemented Interfaces:
    org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
    Direct Known Subclasses:
    BuildinfoMojo, CompareMojo

    public abstract class AbstractBuildinfoMojo
    extends org.apache.maven.plugin.AbstractMojo
    Base buildinfo-generating class, for goals related to Reproducible Builds .buildinfo files.
    Since:
    3.2.0
    • Field Detail

      • project

        @Component
        protected org.apache.maven.project.MavenProject project
        The Maven project.
      • buildinfoFile

        @Parameter(defaultValue="${project.build.directory}/${project.artifactId}-${project.version}.buildinfo",
                   required=true,
                   readonly=true)
        protected File buildinfoFile
        Location of the generated buildinfo file.
      • session

        @Component
        protected org.apache.maven.execution.MavenSession session
        The current build session instance. This is used for toolchain manager API calls.
      • artifactHandlerManager

        @Component
        protected org.apache.maven.artifact.handler.manager.ArtifactHandlerManager artifactHandlerManager
      • rtInformation

        @Component
        protected org.apache.maven.rtinfo.RuntimeInformation rtInformation
    • Constructor Detail

      • AbstractBuildinfoMojo

        public AbstractBuildinfoMojo()
    • Method Detail

      • execute

        public void execute()
                     throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • skip

        protected void skip​(org.apache.maven.project.MavenProject last)
                     throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • copyAggregateToRoot

        protected void copyAggregateToRoot​(File aggregate)
                                    throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • generateBuildinfo

        protected Map<org.apache.maven.artifact.Artifact,​String> generateBuildinfo​(boolean mono)
                                                                                  throws org.apache.maven.plugin.MojoExecutionException
        Generate buildinfo file.
        Parameters:
        mono - is it a mono-module build?
        Returns:
        a Map of artifacts added to the build info with their associated property key prefix (outputs.[#module.].#artifact)
        Throws:
        org.apache.maven.plugin.MojoExecutionException - if anything goes wrong
      • getExecutionRoot

        protected org.apache.maven.project.MavenProject getExecutionRoot()