org.apache.maven.reporting.exec
Class DefaultMavenReportExecutor

java.lang.Object
  extended by 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:

Following steps are done

Since:
3.0-beta-1
Author:
Olivier Lamy

Field Summary
protected  LifecycleExecutor lifecycleExecutor
           
protected  MavenPluginManager mavenPluginManager
           
protected  PluginVersionResolver pluginVersionResolver
           
 
Constructor Summary
DefaultMavenReportExecutor()
           
 
Method Summary
 List<MavenReportExecution> buildMavenReports(MavenReportExecutorRequest mavenReportExecutorRequest)
           
protected  void buildReportPlugin(MavenReportExecutorRequest mavenReportExecutorRequest, ReportPlugin reportPlugin, List<String> reportPluginKeys, List<MavenReportExecution> reports)
           
protected  String getPluginVersion(ReportPlugin reportPlugin, RepositoryRequest repositoryRequest, MavenReportExecutorRequest mavenReportExecutorRequest)
          Resolve report plugin version.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mavenPluginManager

@Requirement
protected MavenPluginManager mavenPluginManager

lifecycleExecutor

@Requirement
protected LifecycleExecutor lifecycleExecutor

pluginVersionResolver

@Requirement
protected PluginVersionResolver pluginVersionResolver
Constructor Detail

DefaultMavenReportExecutor

public DefaultMavenReportExecutor()
Method Detail

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:
  1. use the one defined in the reportPlugin configuration
  2. search similar (same groupId and artifactId) mojo in the build/plugins section of the pom
  3. search similar (same groupId and artifactId) mojo in the build/pluginManagement section of the pom
  4. 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 version
repositoryRequest - 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.