Class AbstractProject<P extends AbstractProject<P,R>,R extends AbstractBuild<P,R>>   
- All Implemented Interfaces:
- ExtensionPoint,- BuildableItem,- DescriptorByNameOwner,- Item,- ModelObject,- PersistenceRoot,- SubTask,- Queue.Task,- ResourceActivity,- Saveable,- SearchableModelObject,- SearchItem,- AccessControlled,- FullyNamed,- FullyNamedModelObject,- LazyBuildMixIn.LazyLoadingJob<P,,- R> - Loadable,- ModelObjectWithChildren,- ModelObjectWithContextMenu,- Named,- ParameterizedJobMixIn.ParameterizedJob<P,,- R> - ITask,- TriggeredItem,- OnMaster,- HasWidgets,- org.kohsuke.stapler.HttpDeletable,- org.kohsuke.stapler.StaplerOverridable,- org.kohsuke.stapler.StaplerProxy
- Direct Known Subclasses:
- Project
Jobs that build software.
 For now this is primarily the common part of Project and MavenModule.- Author:
- Kohsuke Kawaguchi
- See Also:
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classAbstractProjectsubtypes should implement this base class as a descriptor.static classDeprecated.static classBecause the downstream build is in progress, and we are configured to wait for that.static classBecause the upstream build is in progress, and we are configured to wait for that.static classDeprecated.UseLabelValidatorinstead.Nested classes/interfaces inherited from class hudson.model.JobJob.BasicJobDetailFactory, Job.BuildNumberAssigner, Job.DefaultBuildNumberAssigner, Job.LastItemListener, Job.SubItemBuildsLocationImplNested classes/interfaces inherited from interface hudson.ExtensionPointExtensionPoint.LegacyInstancesAreScopedToHudsonNested classes/interfaces inherited from interface org.kohsuke.stapler.HttpDeletableorg.kohsuke.stapler.HttpDeletable.HttpDeletableDispatcherNested classes/interfaces inherited from interface jenkins.model.ModelObjectWithContextMenuModelObjectWithContextMenu.ContextMenu, ModelObjectWithContextMenu.ContextMenuVisibility, ModelObjectWithContextMenu.MenuItem, ModelObjectWithContextMenu.MenuItemTypeNested classes/interfaces inherited from interface jenkins.model.ParameterizedJobMixIn.ParameterizedJobParameterizedJobMixIn.ParameterizedJob.ParameterizedDetailFactory
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final PermissionDeprecated.Just useItem.CANCEL.protected booleanTrue to keep builds of this project in queue when downstream projects are building.protected booleanTrue to keep builds of this project in queue when upstream projects are building.static final AlternativeUiTextProvider.Message<AbstractProject> Deprecated.All the builds keyed by their build number.protected booleanTrue to suspend new builds.Actions contributed from subsidiary objects associated withAbstractProject, such as from triggers, builders, publishers, etc.protected DescribableList<Trigger<?>, TriggerDescriptor> List of allTriggers for this project.Fields inherited from class hudson.model.JobHISTORY_ADAPTER, nextBuildNumber, propertiesFields inherited from class hudson.model.AbstractItemdescription, displayName, name, PRONOUN, SKIP_PERMISSION_CHECK, TASK_NOUN
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescription_getRuns()Gets all the runs.voidaddProperty(JobProperty<? super P> jobProp) AddsJobProperty.protected final <T extends Describable<T>>
 voidvoidaddTrigger(Trigger<?> trigger) booleanbooleanprotected voidBuilds the dependency graph.protected final <T extends Describable<T>>
 List<T> buildDescribable(org.kohsuke.stapler.StaplerRequest2 req, List<? extends Descriptor<T>> descriptors) protected final <T extends Describable<T>>
 List<T> buildDescribable(org.kohsuke.stapler.StaplerRequest req, List<? extends Descriptor<T>> descriptors, String prefix) Deprecated.As of 1.261.voidChecks the permission to see if the current user can abort this executable.booleancheckout(AbstractBuild build, Launcher launcher, BuildListener listener, File changelogFile) Creates an object which performs the actual execution of the task.voiddisable()voiddoBuild(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) voiddoBuildWithParameters(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) doCheckRetryCount(String value) Validates the retry count RegexvoiddoConfigSubmit(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) Accepts submission from the configuration page.org.kohsuke.stapler.HttpResponseWipes out the workspace.voiddoPolling(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) Schedules a new SCM polling command.doWs(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) Serves the workspace files.voidenable()static AbstractProjectfindNearest(String name) Finds aAbstractProjectthat has the name closest to the given name.static AbstractProjectfindNearest(String name, ItemGroup context) Finds aAbstractProjectwhose name (when referenced from the specified context) is closest to the given name.Gets actions contributed to this object.If this project is configured to be always built on this node, return thatNode.Gets the textual representation of the assigned label as it was entered by the user.Looks up a build by its ID.getBuildByNumber(int n) More efficient implementation.Type token for the corresponding build type.Returns the project if any of the downstream project is either building, or queued and not blocked by an upstream/downstream project build.Returns the project if any of the upstream project is either building, or queued and not blocked by an upstream/downstream project build.Gets the human readable display name to be rendered in the "Build Now" link.final List<AbstractProject> Returns only those upstream projects that definesBuildTriggerto this project.If the execution of this task should be blocked for temporary reasons, this method returns a non-null object explaining why.intgetDelay(org.kohsuke.stapler.StaplerRequest req) Deprecated.as of 1.489 InjectTimeDuration.final List<AbstractProject> Gets the otherAbstractProjects that should be built when a build of this project is completed.getEnvironment(Node node, TaskListener listener) Creates an environment variable override for launching processes for this project.Returns candidate build for calculating the estimated duration of the current run.Returns the oldest build in the record.booleanUsed as the color of the status ball for the project.getJDK()Gets the JDK that this project is configured with, or null.Returns the newest build.Gets theNodewhere this project was last built on.Deprecated.as of 1.319 SeegetWorkspace()for a migration strategy.FilePath[]Deprecated.as of 1.319 SeegetWorkspace()for a migration strategy.getNearestBuild(int n) Gets the oldest build #m that satisfiesm ≥ n.getNearestOldBuild(int n) Gets the newest build #m that satisfiesm ≤ n.Get the term used in the UI to represent this kind ofAbstractProject.abstract DescribableList<Publisher, Descriptor<Publisher>> Returns the live list of allPublishers configured for this project.If this job is in the build queue, return its item.intQuiet period for the job.Gets the dependency relationship map between this project (as the source) and that project (as the sink.)Set of labels relevant to this job.protected Set<ResourceActivity> Set of child resource activities of the build of this project (override in child projects).List of necessary resources to perform the build of this project.AbstractProject<?, ?> Gets the nearest ancestorTopLevelItemthat's also anAbstractProject.If a subset ofSubTasks of aQueue.Taskneeds to be collocated with otherSubTasks, thoseSubTasks should return the equal object here.getScm()intfinal RGets some build that has a live workspace.final FilePathGets a workspace for some build of this project.Obtains theSubTasks that constitute this task.final Set<AbstractProject> Gets all the downstream projects including transitive downstream projects.final Set<AbstractProject> Gets all the upstream projects including transitive upstream projects.<T extends Trigger>
 TgetTrigger(Class<T> clazz) Gets the specific trigger, or null if the property is not configured for this job.Gets currently configured triggers.final List<AbstractProject> final FilePathDeprecated.as of 1.319 To support concurrent builds of the same project, this method is moved toAbstractBuild.Deprecated.as of 1.319 Projects no longer have a fixed workspace, ands builds will find an available workspace viaWorkspaceListfor each build (furthermore, that happens after a build is started.) So aResourcerepresentation for a workspace at the project level no longer makes sense.booleanbooleanbooleanhasParticipant(User user) Returns true if this user has made a commit to this project.booleanReturns true if we should display "build now" iconbooleanDoes this project perform concurrent builds?booleanUsed insidepanel.jellyto decide whether to display the config/delete/build links.booleanabstract booleanTrue if the builds of this project producesFingerprintrecords.booleanReturns true if the build is in the queue.protected RLoads an existing build record from disk.protected SearchIndexBuilderDefault implementation that returns empty index.protected RnewBuild()Creates a new build of this project for immediate execution.voidWhen an item is created from scratch (instead of copied), this method will be invoked.voidCalled right after when aItemis loaded from disk.protected voidDoes the real job of deleting the item.poll(TaskListener listener) Checks if there's any update in SCM, and returns true if any is found.booleanpollSCMChanges(TaskListener listener) Deprecated.as of 1.346 Usepoll(TaskListener)instead.protected final <T extends Describable<T>>
 voidremoveFromList(Descriptor<T> item, List<T> collection) voidCalled fromRunto remove it from this job.voidremoveTrigger(TriggerDescriptor trigger) static AbstractProjectresolveForCLI(String name) Used for CLI binding.voidsave()Save the settings to a file.booleanscheduleBuild(int quietPeriod, Cause c, Action... actions) Schedules a build.scheduleBuild2(int quietPeriod) Schedules a build, and returns aFutureobject to wait for the completion of the build.scheduleBuild2(int quietPeriod, Action... actions) Provides a standard implementation ofSCMTriggerItem.scheduleBuild2(int, hudson.model.Action...)to schedule a build with the ability to wait for its result.scheduleBuild2(int quietPeriod, Cause c) Schedules a build of this project, and returns aFutureobject to wait for the completion of the build.scheduleBuild2(int quietPeriod, Cause c, Action... actions) Schedules a build of this project, and returns aFutureobject to wait for the completion of the build.scheduleBuild2(int quietPeriod, Cause c, Collection<? extends Action> actions) Schedules a build of this project, and returns aFutureobject to wait for the completion of the build.booleanSchedules a polling of this project.voidSets the assigned label.voidAssigns this job to the given node.voidsetBlockBuildWhenDownstreamBuilding(boolean b) voidsetBlockBuildWhenUpstreamBuilding(boolean b) voidsetConcurrentBuild(boolean b) voidsetCustomWorkspace(String customWorkspace) User-specified workspace directory, or null if it's up to Jenkins.voidsetDisabled(boolean disabled) voidOverwrites the JDK setting.voidsetQuietPeriod(Integer seconds) Sets the custom quiet period of this project, or revert to the global default if null is given.voidvoidsetScmCheckoutStrategy(SCMCheckoutStrategy scmCheckoutStrategy) protected voidsubmit(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) Derived class can override this to perform additional config submission work.protected voidsubmit(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) Deprecated.booleanSpecifies whether this project may be disabled by the user.protected DescribableList<Trigger<?>, TriggerDescriptor> triggers()protected voideffectively deprecated.Methods inherited from class hudson.model.JobassignBuildNumber, checkRename, createHistoryWidget, delete, doBuildStatus, doChildrenContextMenu, doChildrenContextMenu, doDescription, doDoRename, doRssAll, doRssChangelog, doRssFailed, fastUpdateNextBuildNumber, getACL, getAllJobs, getAllProperties, getBuildDir, getBuildDiscarder, getBuildForCLI, getBuildHealth, getBuildHealthReports, getBuilds, getBuilds, getBuildsAsMap, getBuildsByTimestamp, getBuildStatusIconClassName, getBuildStatusUrl, getBuildTimeGraph, getCharacteristicEnvVars, getDynamic, getEstimatedDuration, getJobTabs, getLastBuildsOverThreshold, getLastCompletedBuild, getLastFailedBuild, getLastStableBuild, getLastSuccessfulBuild, getLastUnstableBuild, getLastUnsuccessfulBuild, getLogRotator, getNewBuilds, getNextBuildNumber, getOverrides, getParametersDefinitionProperty, getPermalinks, getProperties, getProperty, getProperty, getSearchIcon, getTimeline, isBuilding, isHoldOffBuildUntilSave, isKeepDependencies, isLogUpdated, isNameEditable, logRotate, movedTo, onCopiedFrom, removeProperty, removeProperty, renameTo, saveNextBuildNumber, setBuildDiscarder, setLogRotator, supportsLogRotator, updateNextBuildNumberMethods inherited from class hudson.model.AbstractItemdelete, delete, doCheckNewName, doConfigDotXml, doConfigDotXml, doConfirmRename, doDoDelete, doDoDelete, doReload, doSetName, doSubmitDescription, doSubmitDescription, getAbsoluteUrl, getApi, getConfigFile, getDescription, getDisplayName, getDisplayNameOrNull, getFullDisplayName, getFullName, getName, getParent, getRelativeDisplayNameFrom, getRelativeNameFromGroup, getRootDir, getSearchName, getSearchUrl, getShortUrl, getTarget, getTaskNoun, getUrl, load, setDescription, setDisplayName, setDisplayNameOrNull, toString, updateByXml, updateByXml, writeConfigDotXml, writeReplaceMethods inherited from class hudson.model.ActionableaddAction, addOrReplaceAction, doContextMenu, doContextMenu, getAction, getAction, getActions, getAllActions, getDynamic, removeAction, removeActions, replaceAction, replaceActionsMethods inherited from class hudson.model.AbstractModelObjectgetSearch, getSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError, sendError, sendError, sendErrorMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface hudson.security.AccessControlledcheckAnyPermission, checkPermission, getACL, hasAnyPermission, hasPermission, hasPermission, hasPermission2Methods inherited from interface hudson.model.BuildableItemscheduleBuild, scheduleBuildMethods inherited from interface hudson.model.DescriptorByNameOwnergetDescriptorByNameMethods inherited from interface jenkins.widgets.HasWidgetsgetWidget, getWidgetsMethods inherited from interface jenkins.model.queue.ITaskgetFullDisplayName, hasReadPermissionMethods inherited from interface hudson.model.Itemdelete, getAbsoluteUrl, getAllJobs, getDisplayName, getFullName, getName, getParent, getRelativeNameFrom, getRelativeNameFrom, getSearchGroup, getShortUrl, getUrl, onCopiedFromMethods inherited from interface jenkins.model.ParameterizedJobMixIn.ParameterizedJobdoBuild, doBuild, doBuildWithParameters, doBuildWithParameters, doCancelQueue, doDisable, doEnable, getParameterizedJobMixIn, isParameterized, makeDisabled, scheduleBuild, scheduleBuildMethods inherited from interface hudson.model.PersistenceRootgetRootDirMethods inherited from interface hudson.model.Queue.TaskgetAffinityKey, getDefaultAuthentication, getDefaultAuthentication, getDefaultAuthentication2, getDefaultAuthentication2, getName, getUrl, getWhyBlocked, isBuildBlockedMethods inherited from interface hudson.search.SearchableModelObjectgetSearchMethods inherited from interface hudson.search.SearchItemgetSearchIcon, getSearchIndex, getSearchName, getSearchUrlMethods inherited from interface hudson.model.queue.SubTaskgetEstimatedDuration, getOwnerExecutable, getOwnerTask
- 
Field Details- 
builds@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) protected transient RunMap<R extends AbstractBuild<P,R>> buildsAll the builds keyed by their build number. Kept here for binary compatibility only; otherwise usebuildMixIn. External code should usegetBuildByNumber(int)orgetLastBuild()and traverse viaRun.getPreviousBuild()
- 
disabledprotected volatile boolean disabledTrue to suspend new builds.
- 
blockBuildWhenDownstreamBuildingprotected volatile boolean blockBuildWhenDownstreamBuildingTrue to keep builds of this project in queue when downstream projects are building. False by default to keep from breaking existing behavior.
- 
blockBuildWhenUpstreamBuildingprotected volatile boolean blockBuildWhenUpstreamBuildingTrue to keep builds of this project in queue when upstream projects are building. False by default to keep from breaking existing behavior.
- 
triggersList of allTriggers for this project.
- 
transientActionsActions contributed from subsidiary objects associated withAbstractProject, such as from triggers, builders, publishers, etc. We don't want to persist them separately, and these actions come and go as configuration change, so it's kept separate.
- 
ABORTDeprecated.Just useItem.CANCEL.
- 
BUILD_NOW_TEXTDeprecated.
 
- 
- 
Constructor Details- 
AbstractProject
 
- 
- 
Method Details- 
getLazyBuildMixIn- Specified by:
- getLazyBuildMixInin interface- LazyBuildMixIn.LazyLoadingJob<P extends AbstractProject<P,- R>, - R extends AbstractBuild<P, - R>> 
 
- 
saveDescription copied from class:AbstractItemSave the settings to a file.- Specified by:
- savein interface- Item
- Specified by:
- savein interface- Saveable
- Overrides:
- savein class- Job<P extends AbstractProject<P,- R>, - R extends AbstractBuild<P, - R>> 
- Throws:
- IOException- if the persistence failed.
 
- 
onCreatedFromScratchpublic void onCreatedFromScratch()Description copied from interface:ItemWhen an item is created from scratch (instead of copied), this method will be invoked. Used as the post-construction initialization.- Specified by:
- onCreatedFromScratchin interface- Item
 
- 
onLoadDescription copied from class:AbstractItemCalled right after when aItemis loaded from disk. This is an opportunity to do a post load processing.- Specified by:
- onLoadin interface- Item
- Overrides:
- onLoadin class- Job<P extends AbstractProject<P,- R>, - R extends AbstractBuild<P, - R>> 
- Parameters:
- name- Name of the directory (not a path --- just the name portion) from which the configuration was loaded. This usually becomes the- nameof this item.
- Throws:
- IOException
 
- 
triggers@WithBridgeMethods(java.util.List.class) protected DescribableList<Trigger<?>,TriggerDescriptor> triggers()
- 
getEnvironment@NonNull public EnvVars getEnvironment(@CheckForNull Node node, @NonNull TaskListener listener) throws IOException, InterruptedException Description copied from class:JobCreates an environment variable override for launching processes for this project.This is for process launching outside the build execution (such as polling, tagging, deployment, etc.) that happens in a context of a specific job. - Overrides:
- getEnvironmentin class- Job<P extends AbstractProject<P,- R>, - R extends AbstractBuild<P, - R>> 
- Parameters:
- node- Node to eventually run a process on. The implementation must cope with this parameter being null (in which case none of the node specific properties would be reflected in the resulting override.)
- Throws:
- IOException
- InterruptedException
 
- 
performDeleteDescription copied from class:AbstractItemDoes the real job of deleting the item.- Overrides:
- performDeletein class- AbstractItem
- Throws:
- IOException
- InterruptedException
 
- 
isConcurrentBuild@Exported public boolean isConcurrentBuild()Does this project perform concurrent builds?- Specified by:
- isConcurrentBuildin interface- Queue.Task
- Returns:
- by default, false
- Since:
- 1.319
 
- 
setConcurrentBuild- Throws:
- IOException
 
- 
getAssignedLabelIf this project is configured to be always built on this node, return thatNode. Otherwise null.- Specified by:
- getAssignedLabelin interface- SubTask
- Returns:
- by default, null
 
- 
getRelevantLabelsSet of labels relevant to this job. This method is used to determine what agents are relevant to jobs, for example byViews. It does not affect the scheduling. This information is informational and the best-effort basis.- Returns:
- Minimally it should contain getAssignedLabel(). The set can contain null element to correspond to the null return value fromgetAssignedLabel().
- Since:
- 1.456
 
- 
getAssignedLabelStringGets the textual representation of the assigned label as it was entered by the user.
- 
setAssignedLabelSets the assigned label.- Throws:
- IOException
 
- 
setAssignedNodeAssigns this job to the given node. A convenience method oversetAssignedLabel(Label).- Throws:
- IOException
 
- 
getPronounGet the term used in the UI to represent this kind ofAbstractProject. Must start with a capital letter.- Overrides:
- getPronounin class- Job<P extends AbstractProject<P,- R>, - R extends AbstractBuild<P, - R>> 
 
- 
getBuildNowTextGets the human readable display name to be rendered in the "Build Now" link.- Specified by:
- getBuildNowTextin interface- ParameterizedJobMixIn.ParameterizedJob<P extends AbstractProject<P,- R>, - R extends AbstractBuild<P, - R>> 
- Since:
- 1.401
- See Also:
 
- 
getRootProjectGets the nearest ancestorTopLevelItemthat's also anAbstractProject.Some projects (such as matrix projects, Maven projects, or promotion processes) form a tree of jobs that acts as a single unit. This method can be used to find the top most dominating job that covers such a tree. - Returns:
- never null.
- See Also:
 
- 
getWorkspaceDeprecated.as of 1.319 To support concurrent builds of the same project, this method is moved toAbstractBuild. For backward compatibility, this method returns the rightAbstractBuild.getWorkspace()if called fromExecutor, and otherwise the workspace of the last build.If you are calling this method during a build from an executor, switch it to AbstractBuild.getWorkspace(). If you are calling this method to serve a file from the workspace, doing a form validation, etc., then usegetSomeWorkspace()Gets the directory where the module is checked out.- Returns:
- null if the workspace is on an agent that's not connected.
 
- 
getSomeWorkspaceGets a workspace for some build of this project.This is useful for obtaining a workspace for the purpose of form field validation, where exactly which build the workspace belonged is less important. The implementation makes a cursory effort to find some workspace. - Returns:
- null if there's no available workspace.
- Since:
- 1.319
 
- 
getSomeBuildWithWorkspaceGets some build that has a live workspace.- Returns:
- null if no such build exists.
 
- 
getModuleRootDeprecated.as of 1.319 SeegetWorkspace()for a migration strategy.Returns the root directory of the checked-out module.This is usually where pom.xml,build.xmland so on exists.
- 
getModuleRootsDeprecated.as of 1.319 SeegetWorkspace()for a migration strategy.Returns the root directories of all checked-out modules.Some SCMs support checking out multiple modules into the same workspace. In these cases, the returned array will have a length greater than one. - Returns:
- The roots of all modules checked out from the SCM.
 
- 
getQuietPeriodpublic int getQuietPeriod()Description copied from interface:ParameterizedJobMixIn.ParameterizedJobQuiet period for the job.- Specified by:
- getQuietPeriodin interface- ParameterizedJobMixIn.ParameterizedJob<P extends AbstractProject<P,- R>, - R extends AbstractBuild<P, - R>> 
- Returns:
- by default, Jenkins.getQuietPeriod()
 
- 
getScmCheckoutStrategy
- 
setScmCheckoutStrategy- Throws:
- IOException
 
- 
getScmCheckoutRetryCountpublic int getScmCheckoutRetryCount()
- 
getHasCustomQuietPeriodpublic boolean getHasCustomQuietPeriod()
- 
setQuietPeriodSets the custom quiet period of this project, or revert to the global default if null is given.- Throws:
- IOException
 
- 
hasCustomScmCheckoutRetryCountpublic boolean hasCustomScmCheckoutRetryCount()
- 
isBuildablepublic boolean isBuildable()Description copied from class:JobReturns true if we should display "build now" icon- Specified by:
- isBuildablein interface- ParameterizedJobMixIn.ParameterizedJob<P extends AbstractProject<P,- R>, - R extends AbstractBuild<P, - R>> 
- Specified by:
- isBuildablein class- Job<P extends AbstractProject<P,- R>, - R extends AbstractBuild<P, - R>> 
 
- 
isConfigurablepublic boolean isConfigurable()Used insidepanel.jellyto decide whether to display the config/delete/build links.
- 
blockBuildWhenDownstreamBuildingpublic boolean blockBuildWhenDownstreamBuilding()
- 
setBlockBuildWhenDownstreamBuilding- Throws:
- IOException
 
- 
blockBuildWhenUpstreamBuildingpublic boolean blockBuildWhenUpstreamBuilding()
- 
setBlockBuildWhenUpstreamBuilding- Throws:
- IOException
 
- 
isDisabled@Exported public boolean isDisabled()- Specified by:
- isDisabledin interface- ParameterizedJobMixIn.ParameterizedJob<P extends AbstractProject<P,- R>, - R extends AbstractBuild<P, - R>> 
 
- 
setDisabled@Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) public void setDisabled(boolean disabled) - Specified by:
- setDisabledin interface- ParameterizedJobMixIn.ParameterizedJob<P extends AbstractProject<P,- R>, - R extends AbstractBuild<P, - R>> 
 
- 
doCheckRetryCountpublic FormValidation doCheckRetryCount(@QueryParameter String value) throws IOException, jakarta.servlet.ServletException Validates the retry count Regex- Throws:
- IOException
- jakarta.servlet.ServletException
 
- 
supportsMakeDisabledpublic boolean supportsMakeDisabled()Specifies whether this project may be disabled by the user. By default, it can be only if this is aTopLevelItem; would be false for matrix configurations, etc.- Specified by:
- supportsMakeDisabledin interface- ParameterizedJobMixIn.ParameterizedJob<P extends AbstractProject<P,- R>, - R extends AbstractBuild<P, - R>> 
- Returns:
- true if the GUI should allow ParameterizedJobMixIn.ParameterizedJob.doDisable()and the like
- Since:
- 1.475
 
- 
disable- Throws:
- IOException
 
- 
enable- Throws:
- IOException
 
- 
getIconColorDescription copied from class:JobUsed as the color of the status ball for the project.- Overrides:
- getIconColorin class- Job<P extends AbstractProject<P,- R>, - R extends AbstractBuild<P, - R>> 
 
- 
updateTransientActionsprotected void updateTransientActions()effectively deprecated. Since using updateTransientActions correctly under concurrent environment requires a lock that can too easily cause deadlocks.Override createTransientActions()instead.
- 
createTransientActions
- 
getPublishersListReturns the live list of allPublishers configured for this project.This method couldn't be called getPublishers()because existing methods in sub-classes return different inconsistent types.
- 
addPropertyDescription copied from class:JobAddsJobProperty.- Overrides:
- addPropertyin class- Job<P extends AbstractProject<P,- R>, - R extends AbstractBuild<P, - R>> 
- Throws:
- IOException
 
- 
getProminentActions
- 
doConfigSubmit@POST public void doConfigSubmit(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) throws IOException, jakarta.servlet.ServletException, Descriptor.FormException Description copied from class:JobAccepts submission from the configuration page.- Overrides:
- doConfigSubmitin class- Job<P extends AbstractProject<P,- R>, - R extends AbstractBuild<P, - R>> 
- Throws:
- IOException
- jakarta.servlet.ServletException
- Descriptor.FormException
 
- 
scheduleBuildSchedules a build. Important: the actions should be persistable without outside references (e.g. don't store references to this project). To provide parameters for a parameterized project, add a ParametersAction. If no ParametersAction is provided for such a project, one will be created with the default parameter values.- Parameters:
- quietPeriod- the quiet period to observer
- c- the cause for this build which should be recorded
- actions- a list of Actions that will be added to the build
- Returns:
- whether the build was actually scheduled
 
- 
scheduleBuild2@WithBridgeMethods(java.util.concurrent.Future.class) public QueueTaskFuture<R> scheduleBuild2(int quietPeriod, Cause c, Action... actions) Schedules a build of this project, and returns aFutureobject to wait for the completion of the build.- Parameters:
- actions- For the convenience of the caller, this array can contain null, and those will be silently ignored.
 
- 
scheduleBuild2@WithBridgeMethods(java.util.concurrent.Future.class) public QueueTaskFuture<R> scheduleBuild2(int quietPeriod, Cause c, Collection<? extends Action> actions) Schedules a build of this project, and returns aFutureobject to wait for the completion of the build.- Parameters:
- actions- For the convenience of the caller, this collection can contain null, and those will be silently ignored.
- Since:
- 1.383
 
- 
scheduleBuild2@WithBridgeMethods(java.util.concurrent.Future.class) public QueueTaskFuture<R> scheduleBuild2(int quietPeriod) Schedules a build, and returns aFutureobject to wait for the completion of the build.Production code shouldn't be using this, but for tests this is very convenient, so this isn't marked as deprecated. 
- 
scheduleBuild2@WithBridgeMethods(java.util.concurrent.Future.class) public QueueTaskFuture<R> scheduleBuild2(int quietPeriod, Cause c) Schedules a build of this project, and returns aFutureobject to wait for the completion of the build.
- 
scheduleBuild2Description copied from interface:ParameterizedJobMixIn.ParameterizedJobProvides a standard implementation ofSCMTriggerItem.scheduleBuild2(int, hudson.model.Action...)to schedule a build with the ability to wait for its result. That job method is often used during functional tests (JenkinsRule.assertBuildStatusSuccess).- Specified by:
- scheduleBuild2in interface- ParameterizedJobMixIn.ParameterizedJob<P extends AbstractProject<P,- R>, - R extends AbstractBuild<P, - R>> 
- Parameters:
- quietPeriod- seconds to wait before starting (normally 0)
- actions- various actions to associate with the scheduling, such as- ParametersActionor- CauseAction
- Returns:
- a handle by which you may wait for the build to complete (or just start); or null if the build was not actually scheduled for some reason
 
- 
schedulePollingpublic boolean schedulePolling()Schedules a polling of this project.- See Also:
 
- 
isInQueuepublic boolean isInQueue()Returns true if the build is in the queue.- Overrides:
- isInQueuein class- Job<P extends AbstractProject<P,- R>, - R extends AbstractBuild<P, - R>> 
 
- 
getQueueItemDescription copied from class:JobIf this job is in the build queue, return its item.- Overrides:
- getQueueItemin class- Job<P extends AbstractProject<P,- R>, - R extends AbstractBuild<P, - R>> 
 
- 
getJDKGets the JDK that this project is configured with, or null.
- 
setJDKOverwrites the JDK setting.- Throws:
- IOException
 
- 
getAuthToken- Specified by:
- getAuthTokenin interface- ParameterizedJobMixIn.ParameterizedJob<P extends AbstractProject<P,- R>, - R extends AbstractBuild<P, - R>> 
 
- 
_getRunsDescription copied from class:JobGets all the runs. The resulting map must be treated immutable (by employing copy-on-write semantics.) The map is descending order, with newest builds at the top.- Specified by:
- _getRunsin class- Job<P extends AbstractProject<P,- R>, - R extends AbstractBuild<P, - R>> 
- See Also:
 
- 
removeRunDescription copied from class:JobCalled fromRunto remove it from this job. The files are deleted already. So all the callee needs to do is to remove a reference from thisJob.- Specified by:
- removeRunin class- Job<P extends AbstractProject<P,- R>, - R extends AbstractBuild<P, - R>> 
- See Also:
 
- 
getBuildLooks up a build by its ID. More efficient implementation.- Overrides:
- getBuildin class- Job<P extends AbstractProject<P,- R>, - R extends AbstractBuild<P, - R>> 
- See Also:
 
- 
getBuildByNumberMore efficient implementation.- Overrides:
- getBuildByNumberin class- Job<P extends AbstractProject<P,- R>, - R extends AbstractBuild<P, - R>> 
- Parameters:
- n- The build number.
- Returns:
- null if no such build exists.
- See Also:
 
- 
getFirstBuildReturns the oldest build in the record. More efficient implementation.- Overrides:
- getFirstBuildin class- Job<P extends AbstractProject<P,- R>, - R extends AbstractBuild<P, - R>> 
- See Also:
 
- 
getLastBuildDescription copied from class:JobReturns the newest build.- Overrides:
- getLastBuildin class- Job<P extends AbstractProject<P,- R>, - R extends AbstractBuild<P, - R>> 
- See Also:
 
- 
getNearestBuildDescription copied from class:JobGets the oldest build #m that satisfiesm ≥ n. This is useful when you'd like to fetch a build but the exact build might be already gone (deleted, rotated, etc.)- Overrides:
- getNearestBuildin class- Job<P extends AbstractProject<P,- R>, - R extends AbstractBuild<P, - R>> 
- See Also:
 
- 
getNearestOldBuildDescription copied from class:JobGets the newest build #m that satisfiesm ≤ n. This is useful when you'd like to fetch a build but the exact build might be already gone (deleted, rotated, etc.)- Overrides:
- getNearestOldBuildin class- Job<P extends AbstractProject<P,- R>, - R extends AbstractBuild<P, - R>> 
- See Also:
 
- 
getEstimatedDurationCandidatesDescription copied from class:JobReturns candidate build for calculating the estimated duration of the current run. Returns the 3 last successful (stable or unstable) builds, if there are any. Failing to find 3 of those, it will return up to 3 last unsuccessful builds. In any case it will not go more than 6 builds into the past to avoid costly build loading.- Overrides:
- getEstimatedDurationCandidatesin class- Job<P extends AbstractProject<P,- R>, - R extends AbstractBuild<P, - R>> 
- See Also:
 
- 
getBuildClassType token for the corresponding build type. The build class must have two constructors: one taking this project type; and one taking this project type, thenFile.
- 
newBuildCreates a new build of this project for immediate execution.- Throws:
- IOException
 
- 
loadBuildLoads an existing build record from disk.- Throws:
- IOException
 
- 
getActionsGets actions contributed to this object.A new Actioncan be added byActionable.addAction(hudson.model.Action).If you are reading the list, rather than modifying it, use Actionable.getAllActions()instead. This method by default returns only persistent actions (though some subclasses override it to return an extended unmodifiable list).Note that this method returns a read-only view of Actions.BuildSteps and others who want to add a project action should do so by implementingBuildStep.getProjectActions(AbstractProject).- Overrides:
- getActionsin class- Actionable
- Returns:
- a possibly empty list
- See Also:
 
- 
getLastBuiltOnGets theNodewhere this project was last built on.- Specified by:
- getLastBuiltOnin interface- SubTask
- Returns:
- null if no information is available (for example, if no build was done yet.)
 
- 
getSameNodeConstraintDescription copied from interface:SubTaskIf a subset ofSubTasks of aQueue.Taskneeds to be collocated with otherSubTasks, thoseSubTasks should return the equal object here. If null, the execution unit isn't under a colocation constraint.- Specified by:
- getSameNodeConstraintin interface- SubTask
- Returns:
- by default, null
 
- 
getCauseOfBlockageIf the execution of this task should be blocked for temporary reasons, this method returns a non-null object explaining why.Otherwise this method returns null, indicating that the build can proceed right away. This can be used to define mutual exclusion that goes beyond ResourceActivity.getResourceList().A project must be blocked if its own previous build is in progress, or if the blockBuildWhenUpstreamBuilding option is true and an upstream project is building, but derived classes can also check other conditions. - Specified by:
- getCauseOfBlockagein interface- Queue.Task
- Returns:
- by default, null
 
- 
getBuildingDownstreamReturns the project if any of the downstream project is either building, or queued and not blocked by an upstream/downstream project build.This means eventually there will be an automatic triggering of the given project (provided that all builds went smoothly.) 
- 
getBuildingUpstreamReturns the project if any of the upstream project is either building, or queued and not blocked by an upstream/downstream project build.This means eventually there will be an automatic triggering of the given project (provided that all builds went smoothly.) 
- 
getSubTasksDescription copied from interface:Queue.TaskObtains theSubTasks that constitute this task.The collection returned by this method must also contain the primary SubTaskrepresented by thisQueue.Taskobject itself as the first element. The returned value is read-only.At least size 1. - Specified by:
- getSubTasksin interface- Queue.Task
- Returns:
- by default, this
 
- 
createExecutableDescription copied from interface:SubTaskCreates an object which performs the actual execution of the task.- Specified by:
- createExecutablein interface- ParameterizedJobMixIn.ParameterizedJob<P extends AbstractProject<P,- R>, - R extends AbstractBuild<P, - R>> 
- Specified by:
- createExecutablein interface- SubTask
- Returns:
- executable to be launched or null if the executable cannot be
 created (e.g. AbstractProjectis disabled)
- Throws:
- IOException- executable cannot be created
 
- 
checkAbortPermissionpublic void checkAbortPermission()Description copied from interface:Queue.TaskChecks the permission to see if the current user can abort this executable. Returns normally from this method if it's OK.NOTE: If you have implemented AccessControlledthis defaults tocheckPermission(hudson.model.Item.CANCEL);- Specified by:
- checkAbortPermissionin interface- Queue.Task
 
- 
hasAbortPermissionpublic boolean hasAbortPermission()- Specified by:
- hasAbortPermissionin interface- ITask
- Returns:
- trueif the current user can cancel the current task. NOTE: If you have implemented- AccessControlledthis returns by default- hasPermission(Item.CANCEL)
 
- 
getWorkspaceResourceDeprecated.as of 1.319 Projects no longer have a fixed workspace, ands builds will find an available workspace viaWorkspaceListfor each build (furthermore, that happens after a build is started.) So aResourcerepresentation for a workspace at the project level no longer makes sense.If you need to lock a workspace while you do some computation, see the source code of pollSCMChanges(TaskListener)for how to obtain a lock of a workspace throughWorkspaceList.Gets theResourcethat represents the workspace of this project. Useful for locking and mutual exclusion control.
- 
getResourceListList of necessary resources to perform the build of this project.- Specified by:
- getResourceListin interface- ResourceActivity
- Returns:
- never null
 
- 
getResourceActivitiesSet of child resource activities of the build of this project (override in child projects).- Returns:
- The set of child resource activities of the build of this project.
 
- 
checkoutpublic boolean checkout(AbstractBuild build, Launcher launcher, BuildListener listener, File changelogFile) throws IOException, InterruptedException - Throws:
- IOException
- InterruptedException
 
- 
pollSCMChangesDeprecated.as of 1.346 Usepoll(TaskListener)instead.Checks if there's any update in SCM, and returns true if any is found.
- 
pollChecks if there's any update in SCM, and returns true if any is found.The implementation is responsible for ensuring mutual exclusion between polling and builds if necessary. - Since:
- 1.345
 
- 
hasParticipantReturns true if this user has made a commit to this project.- Since:
- 1.191
 
- 
getScm
- 
setScm- Throws:
- IOException
 
- 
addTrigger- Throws:
- IOException
 
- 
removeTrigger- Throws:
- IOException
 
- 
addToListprotected final <T extends Describable<T>> void addToList(T item, List<T> collection) throws IOException - Throws:
- IOException
 
- 
removeFromListprotected final <T extends Describable<T>> void removeFromList(Descriptor<T> item, List<T> collection) throws IOException - Throws:
- IOException
 
- 
getTriggersDescription copied from interface:TriggeredItemGets currently configured triggers. You may use<p:config-trigger/>to configure them.- Specified by:
- getTriggersin interface- TriggeredItem
- Returns:
- a map from trigger kind to instance
 
- 
getTriggerGets the specific trigger, or null if the property is not configured for this job.
- 
isFingerprintConfiguredpublic abstract boolean isFingerprintConfigured()True if the builds of this project producesFingerprintrecords.
- 
getDownstreamProjectsGets the otherAbstractProjects that should be built when a build of this project is completed.
- 
getDownstreamProjectsForApi@Exported(name="downstreamProjects") @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) public List<AbstractProject> getDownstreamProjectsForApi()
- 
getUpstreamProjects
- 
getUpstreamProjectsForApi@Exported(name="upstreamProjects") @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) public List<AbstractProject> getUpstreamProjectsForApi()
- 
getBuildTriggerUpstreamProjectsReturns only those upstream projects that definesBuildTriggerto this project. This is a subset ofgetUpstreamProjects()No longer used in the UI. - Returns:
- A List of upstream projects that has a BuildTriggerto this project.
 
- 
getTransitiveUpstreamProjectsGets all the upstream projects including transitive upstream projects.- Since:
- 1.138
 
- 
getTransitiveDownstreamProjectsGets all the downstream projects including transitive downstream projects.- Since:
- 1.138
 
- 
getRelationshipGets the dependency relationship map between this project (as the source) and that project (as the sink.)- Returns:
- can be empty but not null. build number of this project to the build numbers of that project.
 
- 
buildDependencyGraphBuilds the dependency graph. Since 1.558, not abstract and by default includes dependencies contributed bytriggers().
- 
makeSearchIndexDescription copied from class:AbstractModelObjectDefault implementation that returns empty index.- Overrides:
- makeSearchIndexin class- Job<P extends AbstractProject<P,- R>, - R extends AbstractBuild<P, - R>> 
 
- 
doBuild@Deprecated public void doBuild(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException, javax.servlet.ServletException Deprecated.- Throws:
- IOException
- javax.servlet.ServletException
 
- 
getDelay@Deprecated public int getDelay(org.kohsuke.stapler.StaplerRequest req) throws javax.servlet.ServletException Deprecated.as of 1.489 InjectTimeDuration.Computes the delay by taking the default value and the override in the request parameter into the account.- Throws:
- javax.servlet.ServletException
 
- 
doBuildWithParameters@Deprecated public void doBuildWithParameters(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException, javax.servlet.ServletException Deprecated.- Throws:
- IOException
- javax.servlet.ServletException
 
- 
doPollingpublic void doPolling(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) throws IOException, jakarta.servlet.ServletException Description copied from interface:ParameterizedJobMixIn.ParameterizedJobSchedules a new SCM polling command.- Specified by:
- doPollingin interface- ParameterizedJobMixIn.ParameterizedJob<P extends AbstractProject<P,- R>, - R extends AbstractBuild<P, - R>> 
- Throws:
- IOException
- jakarta.servlet.ServletException
 
- 
submitprotected void submit(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) throws IOException, jakarta.servlet.ServletException, Descriptor.FormException Description copied from class:JobDerived class can override this to perform additional config submission work.- Overrides:
- submitin class- Job<P extends AbstractProject<P,- R>, - R extends AbstractBuild<P, - R>> 
- Throws:
- IOException
- jakarta.servlet.ServletException
- Descriptor.FormException
- Since:
- 2.475
 
- 
submit@Deprecated protected void submit(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException, javax.servlet.ServletException, Descriptor.FormException Deprecated.- Overrides:
- submitin class- Job<P extends AbstractProject<P,- R>, - R extends AbstractBuild<P, - R>> 
- Throws:
- IOException
- javax.servlet.ServletException
- Descriptor.FormException
 
- 
buildDescribable@Deprecated protected final <T extends Describable<T>> List<T> buildDescribable(org.kohsuke.stapler.StaplerRequest req, List<? extends Descriptor<T>> descriptors, String prefix) throws Descriptor.FormException, javax.servlet.ServletException Deprecated.As of 1.261. UsebuildDescribable(StaplerRequest2, List)instead.- Throws:
- Descriptor.FormException
- javax.servlet.ServletException
 
- 
buildDescribableprotected final <T extends Describable<T>> List<T> buildDescribable(org.kohsuke.stapler.StaplerRequest2 req, List<? extends Descriptor<T>> descriptors) throws Descriptor.FormException, jakarta.servlet.ServletException - Throws:
- Descriptor.FormException
- jakarta.servlet.ServletException
 
- 
doWspublic DirectoryBrowserSupport doWs(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) throws IOException, jakarta.servlet.ServletException, InterruptedException Serves the workspace files.- Throws:
- IOException
- jakarta.servlet.ServletException
- InterruptedException
 
- 
doDoWipeOutWorkspacepublic org.kohsuke.stapler.HttpResponse doDoWipeOutWorkspace() throws IOException, InterruptedExceptionWipes out the workspace.- Throws:
- IOException
- InterruptedException
 
- 
findNearestFinds aAbstractProjectthat has the name closest to the given name.- See Also:
 
- 
findNearestFinds aAbstractProjectwhose name (when referenced from the specified context) is closest to the given name.- Since:
- 1.419
- See Also:
 
- 
resolveForCLI@CLIResolver public static AbstractProject resolveForCLI(String name) throws org.kohsuke.args4j.CmdLineException Used for CLI binding.- Throws:
- org.kohsuke.args4j.CmdLineException
 
- 
getCustomWorkspace
- 
setCustomWorkspaceUser-specified workspace directory, or null if it's up to Jenkins.Normally a project uses the workspace location assigned by its parent container, but sometimes people have builds that have hard-coded paths. This is not Filebecause it may have to hold a path representation on another OS.If this path is relative, it's resolved against Node.getRootPath()on the node where this workspace is prepared.- Throws:
- IOException
- Since:
- 1.410
 
 
- 
BlockedBecauseOfBuildInProgressinstead.