public abstract class IvyReporter extends java.lang.Object implements hudson.model.Describable<IvyReporter>, hudson.ExtensionPoint, java.io.Serializable
IvyBuild,
and normally records some information and exposes these
in IvyBuild later.
IvyReporter is first instantiated on the master.
Then during the build, it is serialized and sent over into
the Ant process by serialization. Reporters will then receive
event callbacks as Ant build events. Those event callbacks
are the ones that take IvyBuildProxy.
Once the Ant build completes normally or abnormally, the reporters
will be sent back to the master by serialization again, then
have its end(IvyBuild, Launcher, BuildListener) method invoked.
This is a good opportunity to perform the post-build action.
This is the IvyBuild equivalent of BuildStep. Instances
of IvyReporters are persisted with IvyModule/IvyModuleSet,
possibly with configuration specific to that job.
The callback methods are invoked in the following order:
SEQUENCE := preBuild MODULE* postBuild end MODULE := enterModule leaveModule
When an error happens, the call sequence could be terminated at any point and no further callback methods may be invoked.
IvyReporter can contribute
Action to IvyBuild so that the report can be displayed
in the web UI.
Such action can also implement AggregatableAction if it further
wishes to contribute a separate action to IvyModuleSetBuild.
This mechanism is usually used to provide aggregated report for all the
module builds.
IvyReporters,
Serialized Form| Constructor and Description |
|---|
IvyReporter() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
end(IvyBuild build,
hudson.Launcher launcher,
hudson.model.BuildListener listener)
Called after the Ant/Ivy execution finished and the result is determined.
|
boolean |
enterModule(IvyBuildProxy build,
org.apache.tools.ant.BuildEvent event,
hudson.model.BuildListener listener)
Called when the build enters a next
IvyProject. |
hudson.model.Action |
getAggregatedProjectAction(IvyModuleSet project)
Works like
getProjectAction(IvyModule) but
works at IvyModuleSet level. |
IvyReporterDescriptor |
getDescriptor() |
hudson.model.Action |
getProjectAction(IvyModule module)
Deprecated.
as of 1.21
Use
getProjectActions(IvyModule) instead. |
java.util.Collection<? extends hudson.model.Action> |
getProjectActions(IvyModule module)
Equivalent of
BuildStep.getProjectActions(AbstractProject)
for IvyReporter. |
boolean |
leaveModule(IvyBuildProxy build,
org.apache.tools.ant.BuildEvent event,
hudson.model.BuildListener listener)
Called when the build leaves the current
IvyProject. |
boolean |
postBuild(IvyBuildProxy build,
org.apache.tools.ant.BuildEvent event,
hudson.model.BuildListener listener)
Called after a build of one Ivy module is completed.
|
boolean |
preBuild(IvyBuildProxy build,
org.apache.tools.ant.BuildEvent event,
hudson.model.BuildListener listener)
Called before the actual ant execution begins.
|
public boolean preBuild(IvyBuildProxy build, org.apache.tools.ant.BuildEvent event, hudson.model.BuildListener listener) throws java.lang.InterruptedException, java.io.IOException
moduleDescriptor - Represents the Ivy module to be executed.java.lang.InterruptedException - If the build is interrupted by the user (in an attempt to abort the build.)
Normally the IvyReporter implementations may simply forward the exception
it got from its lower-level functions.java.io.IOException - If the implementation wants to abort the processing when an IOException
happens, it can simply propagate the exception to the caller. This will cause
the build to fail, with the default error message.
Implementations are encouraged to catch IOException on its own to
provide a better error message, if it can do so, so that users have better
understanding on why it failed.public boolean enterModule(IvyBuildProxy build, org.apache.tools.ant.BuildEvent event, hudson.model.BuildListener listener) throws java.lang.InterruptedException, java.io.IOException
IvyProject.
When the current build is a multi-module reactor build, every time the build moves on to the next module, this method will be invoked.
preBuild(hudson.ivy.IvyBuildProxy, org.apache.tools.ant.BuildEvent, hudson.model.BuildListener)java.lang.InterruptedException - See preBuild(hudson.ivy.IvyBuildProxy, org.apache.tools.ant.BuildEvent, hudson.model.BuildListener)java.io.IOException - See preBuild(hudson.ivy.IvyBuildProxy, org.apache.tools.ant.BuildEvent, hudson.model.BuildListener)public boolean leaveModule(IvyBuildProxy build, org.apache.tools.ant.BuildEvent event, hudson.model.BuildListener listener) throws java.lang.InterruptedException, java.io.IOException
IvyProject.java.lang.InterruptedExceptionjava.io.IOExceptionenterModule(hudson.ivy.IvyBuildProxy, org.apache.tools.ant.BuildEvent, hudson.model.BuildListener)public boolean postBuild(IvyBuildProxy build, org.apache.tools.ant.BuildEvent event, hudson.model.BuildListener listener) throws java.lang.InterruptedException, java.io.IOException
Note that at this point the build result is still not determined.
preBuild(hudson.ivy.IvyBuildProxy, org.apache.tools.ant.BuildEvent, hudson.model.BuildListener)java.lang.InterruptedException - See preBuild(hudson.ivy.IvyBuildProxy, org.apache.tools.ant.BuildEvent, hudson.model.BuildListener)java.io.IOException - See preBuild(hudson.ivy.IvyBuildProxy, org.apache.tools.ant.BuildEvent, hudson.model.BuildListener)public boolean end(IvyBuild build, hudson.Launcher launcher, hudson.model.BuildListener listener) throws java.lang.InterruptedException, java.io.IOException
This method fires after postBuild(IvyBuildProxy, BuildEvent, BuildListener).
Works like BuildStepCompatibilityLayer.perform(Build, Launcher, BuildListener).
java.lang.InterruptedExceptionjava.io.IOExceptionpublic hudson.model.Action getProjectAction(IvyModule module)
getProjectActions(IvyModule) instead.BuildStep.getProjectAction(AbstractProject)
for IvyReporter.
Registers a transient action to IvyModule when it's rendered.
This is useful if you'd like to display an action at the module level.
Since this contributes a transient action, the returned Action
will not be serialized.
For this method to be invoked, your IvyReporter has to invoke
IvyBuildProxy.registerAsProjectAction(IvyReporter) during the build.
public java.util.Collection<? extends hudson.model.Action> getProjectActions(IvyModule module)
BuildStep.getProjectActions(AbstractProject)
for IvyReporter.
Registers a transient action to IvyModule when it's rendered.
This is useful if you'd like to display an action at the module level.
Since this contributes a transient action, the returned Action
will not be serialized.
For this method to be invoked, your IvyReporter has to invoke
IvyBuildProxy.registerAsProjectAction(IvyReporter) during the build.
public hudson.model.Action getAggregatedProjectAction(IvyModuleSet project)
getProjectAction(IvyModule) but
works at IvyModuleSet level.
For this method to be invoked, your IvyReporter has to invoke
IvyBuildProxy.registerAsAggregatedProjectAction(IvyReporter) during the build.
public IvyReporterDescriptor getDescriptor()
getDescriptor in interface hudson.model.Describable<IvyReporter>