Package org.apache.maven.plugin.plugin
Class PluginReport
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.apache.maven.reporting.AbstractMavenReport
org.apache.maven.plugin.plugin.PluginReport
- 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="report",
threadSafe=true)
@Execute(phase=PROCESS_CLASSES)
public class PluginReport
extends org.apache.maven.reporting.AbstractMavenReport
Generates the Plugin's documentation report:
plugin-info.html
plugin overview page,
and one goal-mojo.html
per goal.- Since:
- 2.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class
Generates an overview page with the list of goals and a link to the goal's page. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Set<org.apache.maven.artifact.Artifact>
The set of dependencies for the current projectprivate String
The file encoding of the source files.protected String
The goal prefix that will appear before the ":".protected org.apache.maven.artifact.repository.ArtifactRepository
Location of the local repository.protected org.apache.maven.tools.plugin.scanner.MojoScanner
Mojo scanner tools.private File
Report output directory for mojos' documentation.private File
Path toplugin.xml
plugin descriptor to generate the report from.private org.apache.maven.project.MavenProject
The Maven Project.protected List<org.apache.maven.artifact.repository.ArtifactRepository>
List of Remote Repositories used by the resolverprivate Requirements
Specify some requirements to execute this plugin.private org.apache.maven.execution.RuntimeInformation
private org.apache.maven.doxia.siterenderer.Renderer
Doxia Site Renderer.private boolean
Set this to "true" to skip invoking any goals or reports of the plugin.private boolean
Set this to "true" to skip generating the report.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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
protected void
executeReport
(Locale locale) private org.apache.maven.plugin.descriptor.PluginDescriptor
private void
generateMojosDocumentation
(org.apache.maven.plugin.descriptor.PluginDescriptor pluginDescriptor, Locale locale) Generate the mojos documentation, as xdoc files.protected static ResourceBundle
getDescription
(Locale locale) protected String
private org.apache.maven.plugin.descriptor.PluginDescriptorBuilder
Return the pluginDescriptorBuilder to use based on the Maven version: either use the original from the maven-plugin-api or a patched version for Maven versions before the MNG-6109 fix (because of Maven MNG-6109 bug that won't give accurate 'since' info when reading plugin.xml).protected org.apache.maven.project.MavenProject
protected org.apache.maven.doxia.siterenderer.Renderer
Methods inherited from class org.apache.maven.reporting.AbstractMavenReport
closeReport, execute, generate, generate, generate, getCategoryName, getInputEncoding, getOutputEncoding, getReportOutputDirectory, getSink, getSinkFactory, isExternalReport, setReportOutputDirectory
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
outputDirectory
@Parameter(defaultValue="${project.build.directory}/generated-site/xdoc") private File outputDirectoryReport output directory for mojos' documentation. -
siteRenderer
@Component private org.apache.maven.doxia.siterenderer.Renderer siteRendererDoxia Site Renderer. -
project
@Parameter(defaultValue="${project}", readonly=true) private org.apache.maven.project.MavenProject projectThe Maven Project. -
mojoScanner
@Component protected org.apache.maven.tools.plugin.scanner.MojoScanner mojoScannerMojo scanner tools. -
encoding
@Parameter(property="encoding", defaultValue="${project.build.sourceEncoding}") private String encodingThe file encoding of the source files.- Since:
- 2.7
-
requirements
Specify some requirements to execute this plugin. Example:<requirements> <maven>2.0</maven> <jdk>1.4</jdk> <memory>256m</memory> <diskSpace>1m</diskSpace> <others> <property> <name>SVN</name> <value>1.4.6</value> </property> </others> </requirements>
If not is specified, Maven requirement is extracted from<project><prerequisites><maven>
and JDK requirement is extracted from maven-compiler-plugin configuration. -
goalPrefix
The goal prefix that will appear before the ":". By default, this plugin applies a heuristic to derive a heuristic from the plugin's artifactId.
It removes any occurrences of the regular expression -?maven-?, and then removes any occurrences of -?plugin-?.
For example, horsefeature-maven-plugin becomes horsefeature.
(There is a special case for maven-plugin-plugin: it is mapped to 'plugin')
- Since:
- 2.4
-
skip
@Parameter(defaultValue="false", property="maven.plugin.skip") private boolean skipSet this to "true" to skip invoking any goals or reports of the plugin.- Since:
- 2.8
-
skipReport
@Parameter(defaultValue="false", property="maven.plugin.report.skip") private boolean skipReportSet this to "true" to skip generating the report.- Since:
- 2.8
-
dependencies
@Parameter(defaultValue="${project.artifacts}", required=true, readonly=true) protected Set<org.apache.maven.artifact.Artifact> dependenciesThe set of dependencies for the current project- Since:
- 3.0
-
remoteRepos
@Parameter(defaultValue="${project.remoteArtifactRepositories}", required=true, readonly=true) protected List<org.apache.maven.artifact.repository.ArtifactRepository> remoteReposList of Remote Repositories used by the resolver- Since:
- 3.0
-
local
@Parameter(defaultValue="${localRepository}", required=true, readonly=true) protected org.apache.maven.artifact.repository.ArtifactRepository localLocation of the local repository.- Since:
- 3.0
-
rtInfo
@Component private org.apache.maven.execution.RuntimeInformation rtInfo- Since:
- 3.5.1
-
pluginXmlFile
@Parameter(defaultValue="${project.build.outputDirectory}/META-INF/maven/plugin.xml", required=true, readonly=true) private File pluginXmlFilePath toplugin.xml
plugin descriptor to generate the report from.- Since:
- 3.5.1
-
-
Constructor Details
-
PluginReport
public PluginReport()
-
-
Method Details
-
getSiteRenderer
protected org.apache.maven.doxia.siterenderer.Renderer getSiteRenderer()- Overrides:
getSiteRenderer
in classorg.apache.maven.reporting.AbstractMavenReport
-
getOutputDirectory
- Overrides:
getOutputDirectory
in classorg.apache.maven.reporting.AbstractMavenReport
-
getProject
protected org.apache.maven.project.MavenProject getProject()- Overrides:
getProject
in classorg.apache.maven.reporting.AbstractMavenReport
-
canGenerateReport
public boolean canGenerateReport()- Specified by:
canGenerateReport
in interfaceorg.apache.maven.reporting.MavenReport
- Overrides:
canGenerateReport
in classorg.apache.maven.reporting.AbstractMavenReport
-
executeReport
- Specified by:
executeReport
in classorg.apache.maven.reporting.AbstractMavenReport
- Throws:
org.apache.maven.reporting.MavenReportException
-
extractPluginDescriptor
private org.apache.maven.plugin.descriptor.PluginDescriptor extractPluginDescriptor() throws org.apache.maven.reporting.MavenReportException- Throws:
org.apache.maven.reporting.MavenReportException
-
getPluginDescriptorBuilder
private org.apache.maven.plugin.descriptor.PluginDescriptorBuilder getPluginDescriptorBuilder()Return the pluginDescriptorBuilder to use based on the Maven version: either use the original from the maven-plugin-api or a patched version for Maven versions before the MNG-6109 fix (because of Maven MNG-6109 bug that won't give accurate 'since' info when reading plugin.xml).- Returns:
- the proper pluginDescriptorBuilder
-
getDescription
-
getName
-
getOutputName
-
generateMojosDocumentation
private void generateMojosDocumentation(org.apache.maven.plugin.descriptor.PluginDescriptor pluginDescriptor, Locale locale) throws org.apache.maven.reporting.MavenReportException Generate the mojos documentation, as xdoc files.- Parameters:
pluginDescriptor
- not nulllocale
- not null- Throws:
org.apache.maven.reporting.MavenReportException
- if any
-
getBundle
- Parameters:
locale
- not null- Returns:
- the bundle for this report
-