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 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:

  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 fallback version and display a warning as it's not a recommended use.

Following steps are done:

Author:
Olivier Lamy

Field Summary
protected  LifecycleExecutor lifecycleExecutor
           
protected  MavenPluginManager mavenPluginManager
           
protected  MavenPluginManagerHelper mavenPluginManagerHelper
           
protected  PluginVersionResolver pluginVersionResolver
           
 
Constructor Summary
DefaultMavenReportExecutor()
           
 
Method Summary
 List<MavenReportExecution> buildMavenReports(MavenReportExecutorRequest mavenReportExecutorRequest)
           
protected  List<MavenReportExecution> buildReportPlugin(MavenReportExecutorRequest mavenReportExecutorRequest, ReportPlugin reportPlugin)
           
protected  String resolvePluginVersion(ReportPlugin reportPlugin, 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

mavenPluginManagerHelper

@Requirement
protected MavenPluginManagerHelper mavenPluginManagerHelper

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 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:
  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 fallback version and display a warning as it's not a recommended use.

Parameters:
reportPlugin - the report plugin to resolve the version
mavenReportExecutorRequest - the current report execution context
Returns:
the report plugin version
Throws:
PluginVersionResolutionException


Copyright © 2002-2013 The Apache Software Foundation. All Rights Reserved.