Class Publisher
- All Implemented Interfaces:
- Describable<Publisher>,- BuildStep
BuildSteps that run after the build is completed.
 
 To register a custom Publisher from a plugin,
 put Extension on your descriptor implementation.
 
 Starting 1.178, publishers are exposed to all kinds of different
 project type, not just the freestyle project type (in particular,
 the native maven2 job type.) This is convenient default for
 Publishers in particular initially, but we encourage advanced
 plugins to consider writing MavenReporter, as it offers the
 potential of reducing the amount of configuration needed to run the plugin.
 For those plugins that don't want Publisher to show up in
 different job type, use BuildStepDescriptor for the base type
 of your descriptor to control which job type it supports.
- Author:
- Kohsuke Kawaguchi
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic final classPublisherhas a special sort semantics that requires a subtype.Nested classes/interfaces inherited from interface hudson.tasks.BuildStepBuildStep.PublisherList
- 
Field SummaryFields inherited from interface hudson.tasks.BuildStepBUILDERS, PUBLISHERS
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionall()Returns all the registeredPublisherdescriptors.Gets the descriptor for this instance.getProjectAction(Project project) Deprecated.since 1.150booleanReturn true if thisPublisherneeds to run after the build result is fully finalized.booleanprebuild(Build build, BuildListener listener) Deprecated.since 1.150Methods inherited from class hudson.tasks.BuildStepCompatibilityLayergetProjectAction, getProjectActions, perform, perform, prebuildMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface hudson.tasks.BuildStepgetRequiredMonitorService
- 
Constructor Details- 
Publisher
 
- 
- 
Method Details- 
prebuildDeprecated.since 1.150Default implementation that does nothing.- Overrides:
- prebuildin class- BuildStepCompatibilityLayer
 
- 
getProjectActionDeprecated.since 1.150Default implementation that does nothing.- Overrides:
- getProjectActionin class- BuildStepCompatibilityLayer
 
- 
needsToRunAfterFinalizedpublic boolean needsToRunAfterFinalized()Return true if thisPublisherneeds to run after the build result is fully finalized.The execution of normal Publishers are considered within a part of the build. This allows publishers to mark the build as a failure, or to include their execution time in the total build time.So normally, that is the preferable behavior, but in a few cases this is problematic. One of such cases is when a publisher needs to trigger other builds, which in turn need to see this build as a completed build. Those plugins that need to do this can return true from this method, so that the BuildStepCompatibilityLayer.perform(AbstractBuild, Launcher, BuildListener)method is called after the build is marked as completed.When Publisherbehaves this way, note that they can no longer change the build status anymore.- Since:
- 1.153
 
- 
getDescriptorDescription copied from interface:DescribableGets the descriptor for this instance.Descriptoris a singleton for every concreteDescribableimplementation, so ifa.getClass() == b.getClass()then by defaulta.getDescriptor() == b.getDescriptor()as well. (In rare cases a single implementation class may be used for instances with distinct descriptors.)By default looks for a nested class (conventionally named DescriptorImpl) implementingDescriptorand marked withExtension.- Specified by:
- getDescriptorin interface- Describable<Publisher>
 
- 
allReturns all the registeredPublisherdescriptors.
 
- 
Publisherdirectly.