Interface MavenReport

All Known Subinterfaces:
MavenMultiPageReport

public interface MavenReport
The basis for a Maven report: a report that the Maven Site Plugin renders into the project site. Report plugins usually extend AbstractMavenReport from Maven Reporting Implementation instead of implementing this interface directly.
Since:
2.0
Author:
Brett Porter, Emmanuel Venisse, Vincent Siveton
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Category for project information reports
    static final String
    Category for project reports
    static final String
    Plexus lookup name
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Verify some conditions before generating the report, for example that there is something to report on.
    void
    generate(org.apache.maven.doxia.sink.Sink sink, Locale locale)
    Generate the report for the given locale.
    default void
    generate(org.apache.maven.doxia.sink.Sink sink, org.apache.maven.doxia.sink.SinkFactory sinkFactory, Locale locale)
    Generate the report for the given locale, possibly as several pages.
    Get the category name for this report.
    Get the localized report description.
    getName(Locale locale)
    Get the localized report name.
    Deprecated.
    Method name does not properly reflect its purpose.
    default String
    Get the path relative to getReportOutputDirectory() where the report's main output file will be written.
    Get the shared report output directory.
    boolean
    Tell whether this report writes its own output files instead of rendering into the sink, as the Javadoc report does when it calls the javadoc tool.
    void
    setReportOutputDirectory(File outputDirectory)
    Set a new shared report output directory.
  • Field Details

    • ROLE

      static final String ROLE
      Plexus lookup name
    • CATEGORY_PROJECT_INFORMATION

      static final String CATEGORY_PROJECT_INFORMATION
      Category for project information reports
      See Also:
    • CATEGORY_PROJECT_REPORTS

      static final String CATEGORY_PROJECT_REPORTS
      Category for project reports
      See Also:
  • Method Details

    • generate

      void generate(org.apache.maven.doxia.sink.Sink sink, Locale locale) throws MavenReportException
      Generate the report for the given locale.

      A report that renders a single page implements only this method. A report that renders several pages also overrides generate(Sink, SinkFactory, Locale).

      Parameters:
      sink - the sink to use for the generation.
      locale - the wanted locale to generate the report.
      Throws:
      MavenReportException - if any
    • generate

      default void generate(org.apache.maven.doxia.sink.Sink sink, org.apache.maven.doxia.sink.SinkFactory sinkFactory, Locale locale) throws MavenReportException
      Generate the report for the given locale, possibly as several pages.

      A report that renders a single page ignores sinkFactory. A report that renders several pages uses sinkFactory to create the sinks for its sub-pages. By default, this method renders a single page with generate(Sink, Locale).

      Parameters:
      sink - the sink to use for the main page.
      sinkFactory - the factory for sub-page sinks, or null when sub-pages cannot be created.
      locale - the wanted locale to generate the report.
      Throws:
      MavenReportException - if any
      Since:
      4.1.0
    • getOutputPath

      default String getOutputPath()
      Get the path relative to getReportOutputDirectory() where the report's main output file will be written. The last component is the name of the file without any extension. The actual output extension is added by the sink implementation.

      Note: This method won't be default anymore when getOutputName() is removed. You are advised to implement it as soon as possible.

      Returns:
      the relative output path of this report
      Since:
      4.0.0
    • getOutputName

      @Deprecated String getOutputName()
      Deprecated.
      Method name does not properly reflect its purpose. Implement and use getOutputPath() instead.
      Get the name of the report's main output file, without any extension.
      Returns:
      the output name of this report
    • getCategoryName

      String getCategoryName()
      Get the category name for this report.
      Returns:
      the category name of this report. Should be CATEGORY_PROJECT_INFORMATION or CATEGORY_PROJECT_REPORTS
    • getName

      String getName(Locale locale)
      Get the localized report name.
      Parameters:
      locale - the wanted locale to return the report's name.
      Returns:
      the name of this report
    • getDescription

      String getDescription(Locale locale)
      Get the localized report description.
      Parameters:
      locale - the wanted locale to return the report's description.
      Returns:
      the description of this report
    • setReportOutputDirectory

      void setReportOutputDirectory(File outputDirectory)
      Set a new shared report output directory. This directory may contain the output of other reports as well.
      Parameters:
      outputDirectory - the new shared report output directory
    • getReportOutputDirectory

      File getReportOutputDirectory()
      Get the shared report output directory.
      Returns:
      the current shared report output directory
    • isExternalReport

      boolean isExternalReport()
      Tell whether this report writes its own output files instead of rendering into the sink, as the Javadoc report does when it calls the javadoc tool. The Maven Site Plugin does not decorate an external report with the site skin.
      Returns:
      true if this report is external, false otherwise. Most reports return false.
    • canGenerateReport

      boolean canGenerateReport() throws MavenReportException
      Verify some conditions before generating the report, for example that there is something to report on. The Maven Site Plugin skips a report that returns false.
      Returns:
      true if this report can be generated, false otherwise.
      Throws:
      MavenReportException - if any