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 need 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 search 
   with method getPluginVersion(ReportPlugin, RepositoryRequest, 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 version and display a warning as it's not a recommended use   
   
 
 
   Following steps are done
   
     - get 
PluginDescriptor from the MavenPluginManager#getPluginDescriptor(Plugin, RepositoryRequest) 
     - 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 (with using an ExclusionSetFilter: 
       doxia-site-renderer, doxia-sink-api, maven-reporting-api.
       done using MavenPluginManager#setupPluginRealm(PluginDescriptor, org.apache.maven.execution.MavenSession, ClassLoader, List, org.apache.maven.artifact.resolver.filter.ArtifactFilter)
      
     - 
       setup the mojo using 
MavenPluginManager.getConfiguredMojo(Class, org.apache.maven.execution.MavenSession, MojoExecution)
      
     - 
       verify with 
LifecycleExecutor.calculateForkedExecutions(MojoExecution, org.apache.maven.execution.MavenSession)
       if any forked execution is needed: if yes executes the forked execution here
      
   
 
- Since:
 
  - 3.0-beta-1
 
- 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
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 void buildReportPlugin(MavenReportExecutorRequest mavenReportExecutorRequest,
                                 ReportPlugin reportPlugin,
                                 List<String> reportPluginKeys,
                                 List<MavenReportExecution> reports)
                          throws Exception
 
- Throws:
 Exception
 
getPluginVersion
protected String getPluginVersion(ReportPlugin reportPlugin,
                                  RepositoryRequest repositoryRequest,
                                  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 version and display a warning as it's not a recommended use   
 
 
- Parameters:
 reportPlugin - the report plugin to resolve the versionrepositoryRequest - TODO: unused, to be removed?mavenReportExecutorRequest - the current report execution context
- Returns:
 - the report plugin version
 - Throws:
 PluginVersionResolutionException
 
 
Copyright © 2002-2012 The Apache Software Foundation. All Rights Reserved.