Class 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 disableInternalJavadocLinkValidation
      In case the internal javadoc site has not been generated when running this report goal (e.g.
      private java.io.File enhancedPluginXmlFile
      Path to enhanced plugin descriptor to generate the report from (must contain some XHTML values)
      private boolean hasExtensionsToLoad
      Set this to "true" to generate the usage section for "plugin-info.html" with <extensions>true</extensions>.
      private org.codehaus.plexus.i18n.I18N i18n
      Internationalization component.
      private org.apache.maven.execution.MavenSession mavenSession  
      private org.apache.maven.project.ProjectBuilder projectBuilder  
      private org.eclipse.aether.RepositorySystem repositorySystem  
      private java.util.List<RequirementsHistory> requirementsHistories
      The Plugin requirements history list.
      private java.lang.String requirementsHistoryDetectionRange
      Plugin's version range for automatic detection of requirements history.
      private org.apache.maven.rtinfo.RuntimeInformation rtInfo  
      private boolean skip
      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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private org.apache.maven.project.MavenProject buildMavenProject​(java.lang.String version)  
      boolean canGenerateReport()
      private java.util.List<org.eclipse.aether.version.Version> discoverVersions​(java.lang.String range)  
      protected void executeReport​(java.util.Locale locale)
      private org.apache.maven.plugin.descriptor.PluginDescriptor extractPluginDescriptor()  
      private void generateMojosDocumentation​(org.apache.maven.plugin.descriptor.PluginDescriptor pluginDescriptor, java.util.Locale locale)
      Generate the mojos' documentation with the AbstractMavenReport.getSinkFactory()
      java.lang.String getDescription​(java.util.Locale locale)
      private java.lang.String getI18nString​(java.util.Locale locale, java.lang.String key)  
      java.lang.String getName​(java.util.Locale locale)
      java.lang.String getOutputName()
      • 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 Detail

      • 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 java.util.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 java.lang.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 java.io.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 Detail

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

      • 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​(java.util.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 java.lang.String getI18nString​(java.util.Locale locale,
                                               java.lang.String key)
        Parameters:
        locale - The locale
        key - The key to search for
        Returns:
        The text appropriate for the locale.
      • getName

        public java.lang.String getName​(java.util.Locale locale)
      • getDescription

        public java.lang.String getDescription​(java.util.Locale locale)
      • getOutputName

        public java.lang.String getOutputName()
      • generateMojosDocumentation

        private void generateMojosDocumentation​(org.apache.maven.plugin.descriptor.PluginDescriptor pluginDescriptor,
                                                java.util.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
        java.io.IOException
      • discoverVersions

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

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