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.MavenReport
@Mojo(name="rat", requiresDependencyResolution=TEST) public class RatReportMojo extends AbstractRatMojo implements org.apache.maven.reporting.MavenReportGenerates a report with Rat's output.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDOT_HTMLprivate org.apache.maven.artifact.factory.ArtifactFactoryfactoryprivate org.apache.maven.artifact.repository.ArtifactRepositorylocalRepositoryprivate java.io.FileoutputDirectorySpecifies the directory where the report will be generatedprivate org.apache.maven.artifact.resolver.ArtifactResolverresolverprivate org.apache.maven.doxia.siterenderer.RenderersiteRenderer-
Fields inherited from class org.apache.rat.mp.AbstractRatMojo
skip
-
-
Constructor Summary
Constructors Constructor Description RatReportMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanGenerateReport()Returns, whether the report may be generated.voidexecute()Called from Maven to invoke the plugin.voidgenerate(org.codehaus.doxia.sink.Sink sink, java.util.Locale locale)Writes the report to the Doxia sink.private java.util.ResourceBundlegetBundle(java.util.Locale locale)Returns the reports bundlejava.lang.StringgetCategoryName()Returns the reports category name.java.lang.StringgetDescription(java.util.Locale locale)Returns the reports description.java.lang.StringgetName(java.util.Locale locale)Returns the reports name.java.lang.StringgetOutputName()Returns the reports file name.private java.lang.StringgetRatVersion()Searches for a Rat artifact in the dependency list and returns its version.java.io.FilegetReportOutputDirectory()Returns the reports output directory.private org.apache.maven.artifact.ArtifactgetSkinArtifactFile()Returns the skins artifact file.booleanisExternalReport()Returns, whether this is an external report.voidsetReportOutputDirectory(java.io.File pOutputDirectory)Sets the reports output directory.-
Methods inherited from class org.apache.rat.mp.AbstractRatMojo
createReport, createReport, getConfiguration, getProject, getResources
-
-
-
-
Field Detail
-
DOT_HTML
public static final java.lang.String DOT_HTML
- See Also:
- Constant Field Values
-
siteRenderer
@Component private org.apache.maven.doxia.siterenderer.Renderer siteRenderer
-
factory
@Component private org.apache.maven.artifact.factory.ArtifactFactory factory
-
resolver
@Component private org.apache.maven.artifact.resolver.ArtifactResolver resolver
-
outputDirectory
@Parameter(defaultValue="${project.reporting.outputDirectory}", required=true) private java.io.File outputDirectorySpecifies the directory where the report will be generated
-
localRepository
@Parameter(defaultValue="${localRepository}", required=true, readonly=true) private org.apache.maven.artifact.repository.ArtifactRepository localRepository
-
-
Method Detail
-
getSkinArtifactFile
private org.apache.maven.artifact.Artifact getSkinArtifactFile() throws org.apache.maven.plugin.MojoFailureException, org.apache.maven.plugin.MojoExecutionExceptionReturns the skins artifact file.- Returns:
- Artifact file
- Throws:
org.apache.maven.plugin.MojoFailureException- An error in the plugin configuration was detected.org.apache.maven.plugin.MojoExecutionException- An error occurred while searching for the artifact file.
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureExceptionCalled from Maven to invoke the plugin.- Specified by:
executein interfaceorg.apache.maven.plugin.Mojo- Throws:
org.apache.maven.plugin.MojoFailureException- An error in the plugin configuration was detected.org.apache.maven.plugin.MojoExecutionException- An error occurred while creating the report.
-
canGenerateReport
public boolean canGenerateReport()
Returns, whether the report may be generated.- Specified by:
canGenerateReportin interfaceorg.apache.maven.reporting.MavenReport- Returns:
- Always true.
-
getRatVersion
private java.lang.String getRatVersion()
Searches for a Rat artifact in the dependency list and returns its version.- Returns:
- Version number, if found, or null.
-
generate
public void generate(org.codehaus.doxia.sink.Sink sink, java.util.Locale locale) throws org.apache.maven.reporting.MavenReportExceptionWrites the report to the Doxia sink.- Specified by:
generatein interfaceorg.apache.maven.reporting.MavenReport- Parameters:
sink- The doxia sink, kind of a SAX handler.locale- The locale to use for writing the report.- Throws:
org.apache.maven.reporting.MavenReportException- Writing the report failed.
-
getCategoryName
public java.lang.String getCategoryName()
Returns the reports category name.- Specified by:
getCategoryNamein interfaceorg.apache.maven.reporting.MavenReport- Returns:
MavenReport.CATEGORY_PROJECT_REPORTS
-
getBundle
private java.util.ResourceBundle getBundle(java.util.Locale locale)
Returns the reports bundle- Parameters:
locale- Requested locale of the bundle- Returns:
- The bundle, which is used to read localized strings.
-
getDescription
public java.lang.String getDescription(java.util.Locale locale)
Returns the reports description.- Specified by:
getDescriptionin 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
public java.lang.String getName(java.util.Locale locale)
Returns the reports name.- Specified by:
getNamein 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
public java.lang.String getOutputName()
Returns the reports file name.- Specified by:
getOutputNamein interfaceorg.apache.maven.reporting.MavenReport- Returns:
- "rat-report"
-
getReportOutputDirectory
public java.io.File getReportOutputDirectory()
Returns the reports output directory.- Specified by:
getReportOutputDirectoryin interfaceorg.apache.maven.reporting.MavenReport- Returns:
- Value of the "outputDirectory" parameter.
-
isExternalReport
public boolean isExternalReport()
Returns, whether this is an external report.- Specified by:
isExternalReportin interfaceorg.apache.maven.reporting.MavenReport- Returns:
- Always false.
-
setReportOutputDirectory
public void setReportOutputDirectory(java.io.File pOutputDirectory)
Sets the reports output directory.- Specified by:
setReportOutputDirectoryin interfaceorg.apache.maven.reporting.MavenReport- Parameters:
pOutputDirectory- Reports target directory.
-
-