Class PluginReport

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

@Mojo(name="report", threadSafe=true) @Execute(phase=PROCESS_CLASSES) public class PluginReport extends org.apache.maven.reporting.AbstractMavenReport
Generates the plugin's report: the plugin details page at plugin-info.html and one goal-mojo.html per goal. Relies on one output file from plugin:descriptor.
Since:
3.7.0
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private boolean
    In case the internal javadoc site has not been generated when running this report goal (e.g.
    private File
    Path to enhanced plugin descriptor to generate the report from (must contain some XHTML values)
    private boolean
    Set this to "true" to generate the usage section for "plugin-info.html" with <extensions>true</extensions>.
    private final org.codehaus.plexus.i18n.I18N
    Internationalization component.
    private final org.apache.maven.execution.MavenSession
     
    private final org.apache.maven.project.ProjectBuilder
     
    private final org.eclipse.aether.RepositorySystem
     
    The Plugin requirements history list.
    private String
    Plugin's version range for automatic detection of requirements history.
    private final org.apache.maven.rtinfo.RuntimeInformation
     
    private boolean
    Set this to "true" to skip generating the report.

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

    locale, mojoExecution, outputDirectory, outputFormat, outputTimestamp, project, reactorProjects, remoteProjectRepositories, repoSession, siteDirectory, siteRenderer, siteTool

    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
    PluginReport(org.apache.maven.rtinfo.RuntimeInformation rtInfo, org.codehaus.plexus.i18n.I18N i18n, org.apache.maven.execution.MavenSession mavenSession, org.eclipse.aether.RepositorySystem repositorySystem, org.apache.maven.project.ProjectBuilder projectBuilder)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    private org.apache.maven.project.MavenProject
     
    boolean
    private List<org.eclipse.aether.version.Version>
     
    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 with the AbstractMavenReport.getSinkFactory()
    private String
    getI18nString(Locale locale, String key)
     
    getName(Locale locale)

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

    closeReport, constructXrefLocation, execute, generate, generate, getCategoryName, getInputEncoding, getLocale, getOutputDirectory, getOutputEncoding, getProject, getReportOutputDirectory, getSink, getSinkFactory, getSiteRenderer, getXrefLocation, 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

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

    getOutputPath
  • Field Details

    • skip

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

      @Parameter(defaultValue="false", property="maven.plugin.report.hasExtensionsToLoad") private boolean hasExtensionsToLoad
      Set this to "true" to generate the usage section for "plugin-info.html" with <extensions>true</extensions>.
      Since:
      3.7.0
    • requirementsHistories

      @Parameter private List<RequirementsHistory> requirementsHistories
      The Plugin requirements history list.

      Can be specified as list of requirementsHistory:

       <requirementsHistories>
         <requirementsHistory>
           <version>plugin version</version>
           <maven>maven version</maven>
           <jdk>jdk version</jdk>
         </requirementsHistory>
       </requirementsHistories>
       
      Since:
      3.7.0
    • requirementsHistoryDetectionRange

      @Parameter(defaultValue="[0,)") private String requirementsHistoryDetectionRange
      Plugin's version range for automatic detection of requirements history.
      Since:
      3.12.0
    • rtInfo

      private final org.apache.maven.rtinfo.RuntimeInformation rtInfo
    • i18n

      private final org.codehaus.plexus.i18n.I18N i18n
      Internationalization component.
    • enhancedPluginXmlFile

      @Parameter(defaultValue="${project.build.directory}/plugin-enhanced.xml", required=true, readonly=true) private File enhancedPluginXmlFile
      Path to enhanced plugin descriptor to generate the report from (must contain some XHTML values)
      Since:
      3.7.0
    • disableInternalJavadocLinkValidation

      @Parameter(property="maven.plugin.report.disableInternalJavadocLinkValidation") private boolean disableInternalJavadocLinkValidation
      In case the internal javadoc site has not been generated when running this report goal (e.g. when using an aggregator javadoc report) link validation needs to be disabled by setting this value to true. This might have the drawback that some links being generated in the report might be broken in case not all parameter types and javadoc link references are resolvable through the sites being given to goal plugin:descriptor.
      Since:
      3.7.0
    • mavenSession

      private final org.apache.maven.execution.MavenSession mavenSession
    • repositorySystem

      private final org.eclipse.aether.RepositorySystem repositorySystem
    • projectBuilder

      private final org.apache.maven.project.ProjectBuilder projectBuilder
  • Constructor Details

    • PluginReport

      @Inject public PluginReport(org.apache.maven.rtinfo.RuntimeInformation rtInfo, org.codehaus.plexus.i18n.I18N i18n, org.apache.maven.execution.MavenSession mavenSession, org.eclipse.aether.RepositorySystem repositorySystem, org.apache.maven.project.ProjectBuilder projectBuilder)
  • Method Details

    • 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
    • getI18nString

      private String getI18nString(Locale locale, String key)
      Parameters:
      locale - The locale
      key - The key to search for
      Returns:
      The text appropriate for the locale.
    • getName

      public String getName(Locale locale)
    • getDescription

      public String getDescription(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 with the AbstractMavenReport.getSinkFactory()
      Parameters:
      pluginDescriptor - not null
      locale - not null
      Throws:
      org.apache.maven.reporting.MavenReportException - if any
      IOException
    • discoverVersions

      private List<org.eclipse.aether.version.Version> discoverVersions(String range) throws org.eclipse.aether.resolution.VersionRangeResolutionException
      Throws:
      org.eclipse.aether.resolution.VersionRangeResolutionException
    • buildMavenProject

      private org.apache.maven.project.MavenProject buildMavenProject(String version) throws org.apache.maven.project.ProjectBuildingException
      Throws:
      org.apache.maven.project.ProjectBuildingException