de.smartics.maven.plugin.buildmetadata
Class AbstractReportMojo

Package class diagram package AbstractReportMojo
java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.apache.maven.reporting.AbstractMavenReport
          extended by de.smartics.maven.plugin.buildmetadata.AbstractReportMojo
All Implemented Interfaces:
ContextEnabled, Mojo, MavenReport
Direct Known Subclasses:
BuildReportMojo

public abstract class AbstractReportMojo
     
     
extends AbstractMavenReport

The abstract base implementation for reports.

Author:
Robert Reiner

Field Summary
protected  ArtifactFactory factory
          The factory to create dependent artifacts.
protected  String locale
          The locale to use regardless of the report.
protected  ArtifactRepository localRepository
          Local Repository.
protected  String logLevel
          Specifies the log level buildmetadata.logLevel used for this plugin.
protected  File outputDirectory
          Specifies the directory where the report will written to.
protected  MavenProject project
          The Maven project.
protected  ArtifactResolver resolver
          The resolver for resolving artifacts.
protected  org.apache.maven.doxia.siterenderer.Renderer siteRenderer
          The Doxia site renderer.
protected  boolean skip
          A simple flag to skip the generation of the reports.
 
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
AbstractReportMojo()
           
 
Method Summary
 boolean canGenerateReport()
          
 void execute()
          Runs the report generation.
protected  void executeReport(Locale locale)
          
protected  ResourceBundle getBundle(Locale locale)
          Returns the resource bundle for the given locale.
protected  String getOutputDirectory()
          
protected  MavenProject getProject()
          
protected  org.apache.maven.doxia.siterenderer.Renderer getSiteRenderer()
          
protected  void provideSink()
          Ensures that a writeable sink is provided.
 
Methods inherited from class org.apache.maven.reporting.AbstractMavenReport
closeReport, generate, getCategoryName, getReportOutputDirectory, getSink, 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
getDescription, getName, getOutputName
 

Field Detail

project

protected MavenProject project
The Maven project.

Since:
1.0

siteRenderer

protected org.apache.maven.doxia.siterenderer.Renderer siteRenderer
The Doxia site renderer.

Since:
1.0

localRepository

protected ArtifactRepository localRepository
Local Repository.

Since:
1.0

resolver

protected ArtifactResolver resolver
The resolver for resolving artifacts.

Since:
1.0

factory

protected ArtifactFactory factory
The factory to create dependent artifacts.

Since:
1.0

outputDirectory

protected File outputDirectory
Specifies the directory where the report will written to. This information is only used if the report is not part of the site generation process.

Since:
1.0

logLevel

protected String logLevel
Specifies the log level buildmetadata.logLevel used for this plugin.

Allowed values are SEVERE, WARNING, INFO and FINEST.

Since:
1.0

locale

protected String locale
The locale to use regardless of the report. This should be set to the locale the Javadoc comment is written in. If not set, the Maven provided locale is used.

Since:
1.0

skip

protected boolean skip
A simple flag to skip the generation of the reports. If set on the command line use -Dbuildmetadata.skip.

Since:
1.0
Constructor Detail

AbstractReportMojo

public AbstractReportMojo()
Method Detail

getProject

protected final MavenProject getProject()

Specified by:
getProject in class AbstractMavenReport
See Also:
AbstractMavenReport.getProject()

getSiteRenderer

protected final org.apache.maven.doxia.siterenderer.Renderer getSiteRenderer()

Specified by:
getSiteRenderer in class AbstractMavenReport
See Also:
AbstractMavenReport.getSiteRenderer()

getOutputDirectory

protected final String getOutputDirectory()

Specified by:
getOutputDirectory in class AbstractMavenReport
See Also:
AbstractMavenReport.getOutputDirectory()

execute

public void execute()
             throws MojoExecutionException
Runs the report generation.

Specified by:
execute in interface Mojo
Overrides:
execute in class AbstractMavenReport
Throws:
MojoExecutionException - on any problem encountered.

canGenerateReport

public boolean canGenerateReport()

Specified by:
canGenerateReport in interface MavenReport
Overrides:
canGenerateReport in class AbstractMavenReport
See Also:
AbstractMavenReport.canGenerateReport()

executeReport

protected void executeReport(Locale locale)
                      throws MavenReportException

Configures the plugin logger.

Specified by:
executeReport in class AbstractMavenReport
Throws:
MavenReportException
See Also:
AbstractMavenReport.executeReport(java.util.Locale)

provideSink

protected final void provideSink()
                          throws MojoExecutionException
Ensures that a writeable sink is provided.

Stolen from the changes plugin.

Throws:
MojoExecutionException - if the sink cannot be created.

getBundle

protected final ResourceBundle getBundle(Locale locale)
Returns the resource bundle for the given locale.

Parameters:
locale - the locale for which the resource bundle is requested.
Returns:
the bundle for the given locale.


Copyright © 2006-2012 Kronseder & Reiner GmbH - smartics. All Rights Reserved.