Class PluginReport

java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.apache.maven.reporting.AbstractMavenReport
org.apache.maven.plugin.plugin.PluginReport
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo, org.apache.maven.reporting.MavenMultiPageReport, org.apache.maven.reporting.MavenReport

@Mojo(name="report", threadSafe=true) @Execute(phase=PROCESS_CLASSES) public class PluginReport extends org.apache.maven.reporting.AbstractMavenReport
Generates the Plugin's documentation report: plugin-info.html plugin overview page, and one goal-mojo.html per goal.
Since:
2.0
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    (package private) static class 
    Generates an overview page with the list of goals and a link to the goal's page.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected Set<org.apache.maven.artifact.Artifact>
    The set of dependencies for the current project
    private String
    The file encoding of the source files.
    protected String
    The goal prefix that will appear before the ":".
    protected org.apache.maven.artifact.repository.ArtifactRepository
    Location of the local repository.
    protected org.apache.maven.tools.plugin.scanner.MojoScanner
    Mojo scanner tools.
    private File
    Report output directory for mojos' documentation.
    private File
    Path to plugin.xml plugin descriptor to generate the report from.
    private org.apache.maven.project.MavenProject
    The Maven Project.
    protected List<org.apache.maven.artifact.repository.ArtifactRepository>
    List of Remote Repositories used by the resolver
    private Requirements
    Specify some requirements to execute this plugin.
    private org.apache.maven.execution.RuntimeInformation
     
    private org.apache.maven.doxia.siterenderer.Renderer
    Doxia Site Renderer.
    private boolean
    Set this to "true" to skip invoking any goals or reports of the plugin.
    private boolean
    Set this to "true" to skip generating the report.

    Fields inherited from interface org.apache.maven.reporting.MavenReport

    CATEGORY_PROJECT_INFORMATION, CATEGORY_PROJECT_REPORTS, ROLE

    Fields inherited from interface org.apache.maven.plugin.Mojo

    ROLE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    protected void
    private org.apache.maven.plugin.descriptor.PluginDescriptor
     
    private void
    generateMojosDocumentation(org.apache.maven.plugin.descriptor.PluginDescriptor pluginDescriptor, Locale locale)
    Generate the mojos documentation, as xdoc files.
    protected static ResourceBundle
    getBundle(Locale locale)
     
    getName(Locale locale)
    protected String
    private org.apache.maven.plugin.descriptor.PluginDescriptorBuilder
    Return the pluginDescriptorBuilder to use based on the Maven version: either use the original from the maven-plugin-api or a patched version for Maven versions before the MNG-6109 fix (because of Maven MNG-6109 bug that won't give accurate 'since' info when reading plugin.xml).
    protected org.apache.maven.project.MavenProject
    protected org.apache.maven.doxia.siterenderer.Renderer

    Methods inherited from class org.apache.maven.reporting.AbstractMavenReport

    closeReport, execute, generate, generate, generate, getCategoryName, getInputEncoding, getOutputEncoding, getReportOutputDirectory, getSink, getSinkFactory, isExternalReport, setReportOutputDirectory

    Methods inherited from class org.apache.maven.plugin.AbstractMojo

    getLog, getPluginContext, setLog, setPluginContext

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • outputDirectory

      @Parameter(defaultValue="${project.build.directory}/generated-site/xdoc") private File outputDirectory
      Report output directory for mojos' documentation.
    • siteRenderer

      @Component private org.apache.maven.doxia.siterenderer.Renderer siteRenderer
      Doxia Site Renderer.
    • project

      @Parameter(defaultValue="${project}", readonly=true) private org.apache.maven.project.MavenProject project
      The Maven Project.
    • mojoScanner

      @Component protected org.apache.maven.tools.plugin.scanner.MojoScanner mojoScanner
      Mojo scanner tools.
    • encoding

      @Parameter(property="encoding", defaultValue="${project.build.sourceEncoding}") private String encoding
      The file encoding of the source files.
      Since:
      2.7
    • requirements

      @Parameter private Requirements requirements
      Specify some requirements to execute this plugin. Example:
       <requirements>
         <maven>2.0</maven>
         <jdk>1.4</jdk>
         <memory>256m</memory>
         <diskSpace>1m</diskSpace>
         <others>
           <property>
             <name>SVN</name>
             <value>1.4.6</value>
           </property>
         </others>
       </requirements>
       
      If not is specified, Maven requirement is extracted from <project><prerequisites><maven> and JDK requirement is extracted from maven-compiler-plugin configuration.
    • goalPrefix

      @Parameter(property="goalPrefix") protected String goalPrefix

      The goal prefix that will appear before the ":". By default, this plugin applies a heuristic to derive a heuristic from the plugin's artifactId.

      It removes any occurrences of the regular expression -?maven-?, and then removes any occurrences of -?plugin-?.

      For example, horsefeature-maven-plugin becomes horsefeature.

      (There is a special case for maven-plugin-plugin: it is mapped to 'plugin')

      Since:
      2.4
    • skip

      @Parameter(defaultValue="false", property="maven.plugin.skip") private boolean skip
      Set this to "true" to skip invoking any goals or reports of the plugin.
      Since:
      2.8
    • skipReport

      @Parameter(defaultValue="false", property="maven.plugin.report.skip") private boolean skipReport
      Set this to "true" to skip generating the report.
      Since:
      2.8
    • dependencies

      @Parameter(defaultValue="${project.artifacts}", required=true, readonly=true) protected Set<org.apache.maven.artifact.Artifact> dependencies
      The set of dependencies for the current project
      Since:
      3.0
    • remoteRepos

      @Parameter(defaultValue="${project.remoteArtifactRepositories}", required=true, readonly=true) protected List<org.apache.maven.artifact.repository.ArtifactRepository> remoteRepos
      List of Remote Repositories used by the resolver
      Since:
      3.0
    • local

      @Parameter(defaultValue="${localRepository}", required=true, readonly=true) protected org.apache.maven.artifact.repository.ArtifactRepository local
      Location of the local repository.
      Since:
      3.0
    • rtInfo

      @Component private org.apache.maven.execution.RuntimeInformation rtInfo
      Since:
      3.5.1
    • pluginXmlFile

      @Parameter(defaultValue="${project.build.outputDirectory}/META-INF/maven/plugin.xml", required=true, readonly=true) private File pluginXmlFile
      Path to plugin.xml plugin descriptor to generate the report from.
      Since:
      3.5.1
  • Constructor Details

    • PluginReport

      public PluginReport()
  • Method Details

    • getSiteRenderer

      protected org.apache.maven.doxia.siterenderer.Renderer getSiteRenderer()
      Overrides:
      getSiteRenderer in class org.apache.maven.reporting.AbstractMavenReport
    • getOutputDirectory

      protected String getOutputDirectory()
      Overrides:
      getOutputDirectory in class org.apache.maven.reporting.AbstractMavenReport
    • getProject

      protected org.apache.maven.project.MavenProject getProject()
      Overrides:
      getProject in class org.apache.maven.reporting.AbstractMavenReport
    • canGenerateReport

      public boolean canGenerateReport()
      Specified by:
      canGenerateReport in interface org.apache.maven.reporting.MavenReport
      Overrides:
      canGenerateReport in class org.apache.maven.reporting.AbstractMavenReport
    • executeReport

      protected void executeReport(Locale locale) throws org.apache.maven.reporting.MavenReportException
      Specified by:
      executeReport in class org.apache.maven.reporting.AbstractMavenReport
      Throws:
      org.apache.maven.reporting.MavenReportException
    • extractPluginDescriptor

      private org.apache.maven.plugin.descriptor.PluginDescriptor extractPluginDescriptor() throws org.apache.maven.reporting.MavenReportException
      Throws:
      org.apache.maven.reporting.MavenReportException
    • getPluginDescriptorBuilder

      private org.apache.maven.plugin.descriptor.PluginDescriptorBuilder getPluginDescriptorBuilder()
      Return the pluginDescriptorBuilder to use based on the Maven version: either use the original from the maven-plugin-api or a patched version for Maven versions before the MNG-6109 fix (because of Maven MNG-6109 bug that won't give accurate 'since' info when reading plugin.xml).
      Returns:
      the proper pluginDescriptorBuilder
    • getDescription

      public String getDescription(Locale locale)
    • getName

      public String getName(Locale locale)
    • getOutputName

      public String getOutputName()
    • generateMojosDocumentation

      private void generateMojosDocumentation(org.apache.maven.plugin.descriptor.PluginDescriptor pluginDescriptor, Locale locale) throws org.apache.maven.reporting.MavenReportException
      Generate the mojos documentation, as xdoc files.
      Parameters:
      pluginDescriptor - not null
      locale - not null
      Throws:
      org.apache.maven.reporting.MavenReportException - if any
    • getBundle

      protected static ResourceBundle getBundle(Locale locale)
      Parameters:
      locale - not null
      Returns:
      the bundle for this report