org.apache.maven.reporting.exec
Class DefaultMavenReportExecutor
java.lang.Object
org.apache.maven.reporting.exec.DefaultMavenReportExecutor
- All Implemented Interfaces:
- MavenReportExecutor
@Component(role=MavenReportExecutor.class)
public class DefaultMavenReportExecutor
- extends Object
- implements MavenReportExecutor
This component will build some MavenReportExecution
from MavenReportExecutorRequest
.
If a MavenReport
needs to fork a lifecycle, this fork is executed here.
It will ask the core to get some informations in order to correctly setup MavenReport
.
Note if no version is defined in the report plugin, the version will be searched
with method resolvePluginVersion(ReportPlugin, MavenReportExecutorRequest)
Steps to find a plugin version stop after each step if a non null
value has been found:
- use the one defined in the reportPlugin configuration,
- search similar (same groupId and artifactId) mojo in the build/plugins section of the pom,
- search similar (same groupId and artifactId) mojo in the build/pluginManagement section of the pom,
- ask
PluginVersionResolver
to get a fallback version and display a warning as it's not a recommended use.
Following steps are done:
- get
PluginDescriptor
from the MavenPluginManager#getPluginDescriptor(Plugin, RepositoryRequest, RepositorySystemSession)
- setup a
ClassLoader
with the Mojo Site plugin ClassLoader
as parent for the report execution.
You must note some classes are imported from the current Site Mojo ClassRealm: see IMPORTS
.
The artifact resolution excludes the following artifacts, corresponding to imported classes:
doxia-site-renderer, doxia-sink-api, maven-reporting-api.
Done using MavenPluginManager.setupPluginRealm(PluginDescriptor, MavenSession, ClassLoader, List, DependencyFilter)
-
setup the mojo using
MavenPluginManager.getConfiguredMojo(Class, MavenSession, MojoExecution)
-
verify with
LifecycleExecutor.calculateForkedExecutions(MojoExecution, MavenSession)
if any forked execution is needed: if yes, executes the forked execution here
- Author:
- Olivier Lamy
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
mavenPluginManager
@Requirement
protected MavenPluginManager mavenPluginManager
mavenPluginManagerHelper
@Requirement
protected MavenPluginManagerHelper mavenPluginManagerHelper
lifecycleExecutor
@Requirement
protected LifecycleExecutor lifecycleExecutor
pluginVersionResolver
@Requirement
protected PluginVersionResolver pluginVersionResolver
DefaultMavenReportExecutor
public DefaultMavenReportExecutor()
buildMavenReports
public List<MavenReportExecution> buildMavenReports(MavenReportExecutorRequest mavenReportExecutorRequest)
throws MojoExecutionException
- Specified by:
buildMavenReports
in interface MavenReportExecutor
- Returns:
-
- Throws:
MojoExecutionException
buildReportPlugin
protected List<MavenReportExecution> buildReportPlugin(MavenReportExecutorRequest mavenReportExecutorRequest,
ReportPlugin reportPlugin)
throws Exception
- Throws:
Exception
resolvePluginVersion
protected String resolvePluginVersion(ReportPlugin reportPlugin,
MavenReportExecutorRequest mavenReportExecutorRequest)
throws PluginVersionResolutionException
- Resolve report plugin version.
Steps to find a plugin version stop after each step if a non
null
value has been found:
- use the one defined in the reportPlugin configuration,
- search similar (same groupId and artifactId) mojo in the build/plugins section of the pom,
- search similar (same groupId and artifactId) mojo in the build/pluginManagement section of the pom,
- ask
PluginVersionResolver
to get a fallback version and display a warning as it's not a recommended use.
- Parameters:
reportPlugin
- the report plugin to resolve the versionmavenReportExecutorRequest
- the current report execution context
- Returns:
- the report plugin version
- Throws:
PluginVersionResolutionException
Copyright © 2002-2013 The Apache Software Foundation. All Rights Reserved.