hudson.plugins.helpers
Class AbstractMavenReporterImpl

java.lang.Object
  extended by hudson.maven.MavenReporter
      extended by hudson.plugins.helpers.AbstractMavenReporterImpl
All Implemented Interfaces:
hudson.ExtensionPoint, hudson.model.Describable<hudson.maven.MavenReporter>, java.io.Serializable
Direct Known Subclasses:
MavenPublisher

public abstract class AbstractMavenReporterImpl
extends hudson.maven.MavenReporter

See Also:
Serialized Form

Nested Class Summary
protected static class AbstractMavenReporterImpl.MojoExecutionReportingMode
          The reporting mode.
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
hudson.ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Constructor Summary
AbstractMavenReporterImpl()
           
 
Method Summary
protected  boolean autoconfPom(hudson.maven.MavenBuildProxy build, org.apache.maven.project.MavenProject pom, hudson.maven.MojoInfo mojo, hudson.model.BuildListener listener)
          Called during the preExecute phase when isAutoconfMojo returns true.
protected  AbstractMavenReporterImpl.MojoExecutionReportingMode getExecutionMode()
          Returns the execution mode that this reporter will follow.
protected  boolean isAutoconfMojo(hudson.maven.MojoInfo mojo)
          Returns true if this mojo execution is an execution that we want to modify, i.e.
protected abstract  boolean isExecutingMojo(hudson.maven.MojoInfo mojo)
          Returns true if this is the mojo that corresponds with execution of the task we want to report on.
protected abstract  Ghostwriter newGhostwriter(org.apache.maven.project.MavenProject pom, hudson.maven.MojoInfo mojo)
          Creates the configured Ghostwriter based on the information from the pom and mojo.
 boolean postExecute(hudson.maven.MavenBuildProxy build, org.apache.maven.project.MavenProject pom, hudson.maven.MojoInfo mojo, hudson.model.BuildListener listener, java.lang.Throwable error)
          
 boolean preExecute(hudson.maven.MavenBuildProxy build, org.apache.maven.project.MavenProject pom, hudson.maven.MojoInfo mojo, hudson.model.BuildListener listener)
          
 
Methods inherited from class hudson.maven.MavenReporter
end, enterModule, getAggregatedProjectAction, getDescriptor, getProjectAction, leaveModule, postBuild, preBuild, reportGenerated
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractMavenReporterImpl

public AbstractMavenReporterImpl()
Method Detail

getExecutionMode

protected AbstractMavenReporterImpl.MojoExecutionReportingMode getExecutionMode()
Returns the execution mode that this reporter will follow.

Returns:
the execution mode that this reporter will follow.

postExecute

public boolean postExecute(hudson.maven.MavenBuildProxy build,
                           org.apache.maven.project.MavenProject pom,
                           hudson.maven.MojoInfo mojo,
                           hudson.model.BuildListener listener,
                           java.lang.Throwable error)
                    throws java.lang.InterruptedException,
                           java.io.IOException

Overrides:
postExecute in class hudson.maven.MavenReporter
Throws:
java.lang.InterruptedException
java.io.IOException

isExecutingMojo

protected abstract boolean isExecutingMojo(hudson.maven.MojoInfo mojo)
Returns true if this is the mojo that corresponds with execution of the task we want to report on.

Parameters:
mojo - The mojo execution.
Returns:
true if this is the mojo that corresponds with execution of the task we want to report on.

newGhostwriter

protected abstract Ghostwriter newGhostwriter(org.apache.maven.project.MavenProject pom,
                                              hudson.maven.MojoInfo mojo)
Creates the configured Ghostwriter based on the information from the pom and mojo. Will only be called when isExecutingMojo returns true.

Parameters:
pom - The pom.
mojo - The mojo for which isExecutingMojo returned true.
Returns:
The configured Ghostwriter instance.

preExecute

public boolean preExecute(hudson.maven.MavenBuildProxy build,
                          org.apache.maven.project.MavenProject pom,
                          hudson.maven.MojoInfo mojo,
                          hudson.model.BuildListener listener)
                   throws java.lang.InterruptedException,
                          java.io.IOException

Overrides:
preExecute in class hudson.maven.MavenReporter
Throws:
java.lang.InterruptedException
java.io.IOException

autoconfPom

protected boolean autoconfPom(hudson.maven.MavenBuildProxy build,
                              org.apache.maven.project.MavenProject pom,
                              hudson.maven.MojoInfo mojo,
                              hudson.model.BuildListener listener)
Called during the preExecute phase when isAutoconfMojo returns true. if we want to tweak the mojo.configuration to ensure that the mojo is configured with the options we need here is the place to do that for example:

XmlPlexusConfiguration xmlOutputDir = (XmlPlexusConfiguration) mojo.configuration.getChild("xmlOutputDir"); if (xmlOutputDir == null) { xmlOutputDir = new XmlPlexusConfiguration("xmlOutputDir"); xmlOutputDir.setValue("${basedir}/target/xmlReport"); mojo.configuration.addChild(xmlOutputDir); }

Parameters:
build - The build.
pom - The pom which will be manipulated by this method to autoconfigure.
mojo - The mojo.
listener - The build listener.
Returns:
true if autoconf was successful.

isAutoconfMojo

protected boolean isAutoconfMojo(hudson.maven.MojoInfo mojo)
Returns true if this mojo execution is an execution that we want to modify, i.e. where we want to "fix" some of the configuration details, e.g. enable XML reports, etc.

Parameters:
mojo - The mojo.
Returns:
true if this mojo execution is an execution that we want to modify.


Copyright © 2010. All Rights Reserved.