Package org.apache.maven.reporting
Interface MavenReport
- All Known Subinterfaces:
MavenMultiPageReport
public interface MavenReport
The basis for a Maven report.
- Since:
- 2.0
- Author:
- Brett Porter, Emmanuel Venisse, Vincent Siveton
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbooleanVerify some conditions before generating the report.default voidDeprecated.default voidgenerate(org.apache.maven.doxia.sink.Sink sink, org.apache.maven.doxia.sink.SinkFactory sinkFactory, Locale locale) Generate the report depending the wanted locale, possibly as several pages.Get the category name for this report.getDescription(Locale locale) Get the localized report description.Get the localized report name.default StringDeprecated.Method name does not properly reflect its purpose.default StringGet the path relative togetReportOutputDirectory()where the report's main output file will be written.Get the shared report output directory.booleanAn external report is a report which calls a third party program which generates some reports too.voidsetReportOutputDirectory(File outputDirectory) Set a new shared report output directory.
-
Field Details
-
ROLE
Plexus lookup name -
CATEGORY_PROJECT_INFORMATION
Category for project information reports- See Also:
-
CATEGORY_PROJECT_REPORTS
Category for project reports- See Also:
-
-
Method Details
-
generate
@Deprecated default void generate(org.apache.maven.doxia.sink.Sink sink, Locale locale) throws MavenReportException Deprecated.Implement and usegenerate(Sink, SinkFactory, Locale)instead, passingnullas the sink factory when no sub-pages can be created.Generate the report depending the wanted locale.
Mainly used for external reports like javadoc.Note: This method and
generate(Sink, SinkFactory, Locale)delegate to each other by default, so an implementation must override at least one of them.- 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 depending the wanted locale, possibly as several pages.A report that renders a single page ignores
sinkFactory. A report that renders several pages usessinkFactoryto create the sinks for its sub-pages.- Parameters:
sink- the sink to use for the main page.sinkFactory- the factory for sub-page sinks, ornullwhen sub-pages cannot be created.locale- the wanted locale to generate the report.- Throws:
MavenReportException- if any- Since:
- 4.1.0
-
getOutputPath
Get the path relative togetReportOutputDirectory()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 will by added by the sink implementation.Note: This method won't be
defaultanymore whengetOutputName()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.Method name does not properly reflect its purpose. Implement and usegetOutputPath()instead. -
getCategoryName
String getCategoryName()Get the category name for this report.- Returns:
- the category name of this report. Should be
CATEGORY_PROJECT_INFORMATIONorCATEGORY_PROJECT_REPORTS
-
getName
Get the localized report name.- Parameters:
locale- the wanted locale to return the report's name.- Returns:
- the name of this report
-
getDescription
Get the localized report description.- Parameters:
locale- the wanted locale to return the report's description.- Returns:
- the description of this report
-
setReportOutputDirectory
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()An external report is a report which calls a third party program which generates some reports too. A good example is javadoc tool.- Returns:
trueif this report is external,falseotherwise. Default should befalse.
-
canGenerateReport
Verify some conditions before generating the report.- Returns:
trueif this report can be generated,falseotherwise. Default should betrue.- Throws:
MavenReportException- if any
-
generate(Sink, SinkFactory, Locale)instead, passingnullas the sink factory when no sub-pages can be created.