Package org.apache.rat.mp
Class RatReportMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.apache.rat.mp.AbstractRatMojo
org.apache.rat.mp.RatReportMojo
- 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="rat",
requiresDependencyResolution=TEST,
threadSafe=true)
public class RatReportMojo
extends AbstractRatMojo
implements org.apache.maven.reporting.MavenMultiPageReport
Generates a report with Rat's output.
-
Field Summary
Modifier and TypeFieldDescriptionprotected File
The output directory for the report.protected List<org.apache.maven.artifact.repository.ArtifactRepository>
Remote repositories used for the project.protected org.apache.maven.execution.MavenSession
The local repository.protected org.apache.maven.doxia.siterenderer.Renderer
Doxia Site Renderer component.protected org.apache.maven.doxia.tools.SiteTool
SiteTool.Fields inherited from class org.apache.rat.mp.AbstractRatMojo
project, skip
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
-
Method Summary
Modifier and TypeMethodDescriptionboolean
protected void
Actions when closing the report.void
execute()
This method is called when the report generation is invoked directly as a standalone Mojo.protected void
executeReport(Locale locale)
Writes the report to the Doxia sink.void
Deprecated.void
generate(org.apache.maven.doxia.sink.Sink sink, org.apache.maven.doxia.sink.SinkFactory sinkFactory, Locale locale)
This method is called when the report generation is invoked by maven-site-plugin.void
Deprecated.usegenerate(Sink, SinkFactory, Locale)
instead.getDescription(Locale locale)
Returns the reports description.protected String
Gets the input files encoding.Returns the reports name.protected String
protected String
Gets the effective reporting output files encoding.Returns the reports file name.org.apache.maven.doxia.sink.Sink
getSink()
org.apache.maven.doxia.sink.SinkFactory
protected org.apache.maven.doxia.siterenderer.Renderer
boolean
void
setReportOutputDirectory(File reportOutputDirectory)
Methods inherited from class org.apache.rat.mp.AbstractRatMojo
getConfiguration, getDefaultsBuilder, getProject, logLicenses
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
outputDirectory
@Parameter(defaultValue="${project.reporting.outputDirectory}", readonly=true, required=true) protected File outputDirectoryThe output directory for the report. Note that this parameter is only evaluated if the goal is run directly from the command line. If the goal is run indirectly as part of a site generation, the output directory configured in the Maven Site Plugin is used instead. -
session
@Parameter(defaultValue="${session}", readonly=true, required=true) protected org.apache.maven.execution.MavenSession sessionThe local repository. -
remoteRepositories
@Parameter(defaultValue="${project.remoteArtifactRepositories}", readonly=true, required=true) protected List<org.apache.maven.artifact.repository.ArtifactRepository> remoteRepositoriesRemote repositories used for the project. -
siteTool
@Component protected org.apache.maven.doxia.tools.SiteTool siteToolSiteTool. -
siteRenderer
@Component protected org.apache.maven.doxia.siterenderer.Renderer siteRendererDoxia Site Renderer component.
-
-
Constructor Details
-
RatReportMojo
public RatReportMojo()
-
-
Method Details
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionExceptionThis method is called when the report generation is invoked directly as a standalone Mojo.- Specified by:
execute
in interfaceorg.apache.maven.plugin.Mojo
- Throws:
org.apache.maven.plugin.MojoExecutionException
- if an error occurs when generating the report- See Also:
Mojo.execute()
-
generate
@Deprecated public void generate(org.codehaus.doxia.sink.Sink sink, Locale locale) throws org.apache.maven.reporting.MavenReportExceptionDeprecated.usegenerate(Sink, SinkFactory, Locale)
instead.Generate a report.- Specified by:
generate
in interfaceorg.apache.maven.reporting.MavenReport
- Parameters:
sink
- the sink to use for the generation.locale
- the wanted locale to generate the report, could be null.- Throws:
org.apache.maven.reporting.MavenReportException
- if any
-
generate
@Deprecated public void generate(org.apache.maven.doxia.sink.Sink sink, Locale locale) throws org.apache.maven.reporting.MavenReportExceptionDeprecated.usegenerate(Sink, SinkFactory, Locale)
instead.Generate a report.- Parameters:
sink
- the sink to use for the generation.locale
- the wanted locale to generate the report, could be null.- Throws:
org.apache.maven.reporting.MavenReportException
- if any
-
generate
public void generate(org.apache.maven.doxia.sink.Sink sink, org.apache.maven.doxia.sink.SinkFactory sinkFactory, Locale locale) throws org.apache.maven.reporting.MavenReportExceptionThis method is called when the report generation is invoked by maven-site-plugin.- Specified by:
generate
in interfaceorg.apache.maven.reporting.MavenMultiPageReport
- Parameters:
sink
- the sink to use for the generation.sinkFactory
- the sink factory to use for the generation.locale
- the wanted locale to generate the report, could be null.- Throws:
org.apache.maven.reporting.MavenReportException
- if any
-
getCategoryName
- Specified by:
getCategoryName
in interfaceorg.apache.maven.reporting.MavenReport
- Returns:
- CATEGORY_PROJECT_REPORTS
-
getReportOutputDirectory
- Specified by:
getReportOutputDirectory
in interfaceorg.apache.maven.reporting.MavenReport
-
setReportOutputDirectory
- Specified by:
setReportOutputDirectory
in interfaceorg.apache.maven.reporting.MavenReport
-
getOutputDirectory
-
getSiteRenderer
protected org.apache.maven.doxia.siterenderer.Renderer getSiteRenderer() -
getInputEncoding
Gets the input files encoding.- Returns:
- The input files encoding, never
null
.
-
getOutputEncoding
Gets the effective reporting output files encoding.- Returns:
- The effective reporting output file encoding, never
null
.
-
closeReport
protected void closeReport()Actions when closing the report. -
getSink
public org.apache.maven.doxia.sink.Sink getSink()- Returns:
- the sink used
-
getSinkFactory
public org.apache.maven.doxia.sink.SinkFactory getSinkFactory()- Returns:
- the sink factory used
-
isExternalReport
public boolean isExternalReport()- Specified by:
isExternalReport
in interfaceorg.apache.maven.reporting.MavenReport
- Returns:
false
by default.- See Also:
MavenReport.isExternalReport()
-
canGenerateReport
public boolean canGenerateReport()- Specified by:
canGenerateReport
in interfaceorg.apache.maven.reporting.MavenReport
-
executeReport
Writes the report to the Doxia sink.- Parameters:
locale
- The locale to use for writing the report.- Throws:
org.apache.maven.reporting.MavenReportException
- Writing the report failed.
-
getDescription
Returns the reports description.- Specified by:
getDescription
in interfaceorg.apache.maven.reporting.MavenReport
- Parameters:
locale
- Requested locale of the bundle- Returns:
- Report description, as given by the key "report.rat.description" in the bundle.
-
getName
Returns the reports name.- Specified by:
getName
in interfaceorg.apache.maven.reporting.MavenReport
- Parameters:
locale
- Requested locale of the bundle- Returns:
- Report name, as given by the key "report.rat.name" in the bundle.
-
getOutputName
Returns the reports file name.- Specified by:
getOutputName
in interfaceorg.apache.maven.reporting.MavenReport
- Returns:
- "rat-report"
-
generate(Sink, SinkFactory, Locale)
instead.