Package hudson.model
Class Project<P extends Project<P,B>,B extends Build<P,B>>
java.lang.Object
hudson.model.AbstractModelObject
hudson.model.Actionable
hudson.model.AbstractItem
hudson.model.Job<P,B>
hudson.model.AbstractProject<P,B>
hudson.model.Project<P,B>
- All Implemented Interfaces:
ExtensionPoint,BuildableItem,BuildableItemWithBuildWrappers,DescriptorByNameOwner,Item,ModelObject,PersistenceRoot,SubTask,Queue.Task,ResourceActivity,Saveable,SearchableModelObject,SearchItem,AccessControlled,Maven.ProjectWithMaven,FullyNamed,FullyNamedModelObject,LazyBuildMixIn.LazyLoadingJob<P,,B> Loadable,ModelObjectWithChildren,ModelObjectWithContextMenu,Named,ParameterizedJobMixIn.ParameterizedJob<P,,B> ITask,SCMTriggerItem,TriggeredItem,OnMaster,HasWidgets,org.kohsuke.stapler.HttpDeletable,org.kohsuke.stapler.StaplerOverridable,org.kohsuke.stapler.StaplerProxy
- Direct Known Subclasses:
FreeStyleProject
public abstract class Project<P extends Project<P,B>,B extends Build<P,B>>
extends AbstractProject<P,B>
implements SCMTriggerItem, Saveable, Maven.ProjectWithMaven, BuildableItemWithBuildWrappers
Buildable software project.
- Author:
- Kohsuke Kawaguchi
-
Nested Class Summary
Nested classes/interfaces inherited from class hudson.model.AbstractProject
AbstractProject.AbstractProjectDescriptor, AbstractProject.BecauseOfBuildInProgress, AbstractProject.BecauseOfDownstreamBuildInProgress, AbstractProject.BecauseOfUpstreamBuildInProgress, AbstractProject.LabelValidatorNested classes/interfaces inherited from class hudson.model.Job
Job.BasicJobDetailFactory, Job.BuildNumberAssigner, Job.DefaultBuildNumberAssigner, Job.LastItemListener, Job.SubItemBuildsLocationImplNested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudsonNested classes/interfaces inherited from interface org.kohsuke.stapler.HttpDeletable
org.kohsuke.stapler.HttpDeletable.HttpDeletableDispatcherNested classes/interfaces inherited from interface jenkins.model.ModelObjectWithContextMenu
ModelObjectWithContextMenu.ContextMenu, ModelObjectWithContextMenu.ContextMenuVisibility, ModelObjectWithContextMenu.MenuItem, ModelObjectWithContextMenu.MenuItemTypeNested classes/interfaces inherited from interface jenkins.model.ParameterizedJobMixIn.ParameterizedJob
ParameterizedJobMixIn.ParameterizedJob.ParameterizedDetailFactoryNested classes/interfaces inherited from interface jenkins.triggers.SCMTriggerItem
SCMTriggerItem.SCMTriggerItems -
Field Summary
Fields inherited from class hudson.model.AbstractProject
ABORT, blockBuildWhenDownstreamBuilding, blockBuildWhenUpstreamBuilding, BUILD_NOW_TEXT, builds, disabled, transientActions, triggersFields inherited from class hudson.model.Job
HISTORY_ADAPTER, nextBuildNumber, propertiesFields inherited from class hudson.model.AbstractItem
description, displayName, name, PRONOUN, SKIP_PERMISSION_CHECK, TASK_NOUN -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPublisher(Publisher buildStep) Deprecated.asItem()Should bethis.AbstractProject<?, ?> BuildableItemWithBuildWrappersneeds to be an instance ofAbstractProject.protected voidBuilds the dependency graph.BuildWrappers associated with thisAbstractProject.getPublisher(Descriptor<Publisher> descriptor) Deprecated.as of 1.463 We will be soon removing the restriction that only one instance of publisher is allowed per type.Returns the live list of allPublishers configured for this project.protected Set<ResourceActivity> Set of child resource activities of the build of this project (override in child projects).Collection<? extends SCM> getSCMs()Obtains all active SCMs.Gets theMaven.MavenInstallationassociated with the project.booleanTrue if the builds of this project producesFingerprintrecords.voidCalled right after when aItemis loaded from disk.voidremovePublisher(Descriptor<Publisher> descriptor) Deprecated.as of 1.290 UsegetPublishersList().remove(x)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.Methods inherited from class hudson.model.AbstractProject
_getRuns, addProperty, addToList, addTrigger, blockBuildWhenDownstreamBuilding, blockBuildWhenUpstreamBuilding, buildDescribable, buildDescribable, checkAbortPermission, checkout, createExecutable, disable, doBuild, doBuildWithParameters, doCheckRetryCount, doConfigSubmit, doDoWipeOutWorkspace, doPolling, doWs, enable, findNearest, findNearest, getActions, getAssignedLabel, getAssignedLabelString, getAuthToken, getBuild, getBuildByNumber, getBuildClass, getBuildingDownstream, getBuildingUpstream, getBuildNowText, getBuildTriggerUpstreamProjects, getCauseOfBlockage, getCustomWorkspace, getDelay, getDownstreamProjects, getDownstreamProjectsForApi, getEnvironment, getEstimatedDurationCandidates, getFirstBuild, getHasCustomQuietPeriod, getIconColor, getJDK, getLastBuild, getLastBuiltOn, getLazyBuildMixIn, getModuleRoot, getModuleRoots, getNearestBuild, getNearestOldBuild, getProminentActions, getPronoun, getQueueItem, getQuietPeriod, getRelationship, getRelevantLabels, getResourceList, getRootProject, getSameNodeConstraint, getScm, getScmCheckoutRetryCount, getScmCheckoutStrategy, getSomeBuildWithWorkspace, getSomeWorkspace, getSubTasks, getTransitiveDownstreamProjects, getTransitiveUpstreamProjects, getTrigger, getTriggers, getUpstreamProjects, getUpstreamProjectsForApi, getWorkspace, getWorkspaceResource, hasAbortPermission, hasCustomScmCheckoutRetryCount, hasParticipant, isBuildable, isConcurrentBuild, isConfigurable, isDisabled, isInQueue, loadBuild, makeSearchIndex, newBuild, onCreatedFromScratch, performDelete, poll, pollSCMChanges, removeFromList, removeRun, removeTrigger, resolveForCLI, save, scheduleBuild, scheduleBuild2, scheduleBuild2, scheduleBuild2, scheduleBuild2, scheduleBuild2, schedulePolling, setAssignedLabel, setAssignedNode, setBlockBuildWhenDownstreamBuilding, setBlockBuildWhenUpstreamBuilding, setConcurrentBuild, setCustomWorkspace, setDisabled, setJDK, setQuietPeriod, setScm, setScmCheckoutStrategy, supportsMakeDisabled, triggers, updateTransientActionsMethods inherited from class hudson.model.Job
assignBuildNumber, 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.AbstractItem
delete, 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.Actionable
addAction, addOrReplaceAction, doContextMenu, doContextMenu, getAction, getAction, getActions, getAllActions, getDynamic, removeAction, removeActions, replaceAction, replaceActionsMethods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError, sendError, sendError, sendErrorMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface hudson.security.AccessControlled
checkAnyPermission, checkPermission, getACL, hasAnyPermission, hasPermission, hasPermission, hasPermission2Methods inherited from interface hudson.model.BuildableItem
scheduleBuild, scheduleBuildMethods inherited from interface hudson.model.DescriptorByNameOwner
getDescriptorByNameMethods inherited from interface jenkins.widgets.HasWidgets
getWidget, getWidgetsMethods inherited from interface jenkins.model.queue.ITask
getFullDisplayName, hasAbortPermission, hasReadPermissionMethods inherited from interface hudson.model.Item
delete, getAbsoluteUrl, getAllJobs, getDisplayName, getFullName, getName, getParent, getRelativeNameFrom, getRelativeNameFrom, getSearchGroup, getShortUrl, getUrl, onCopiedFrom, onCreatedFromScratch, saveMethods inherited from interface jenkins.model.ParameterizedJobMixIn.ParameterizedJob
doBuild, doBuild, doBuildWithParameters, doBuildWithParameters, doCancelQueue, doDisable, doEnable, getParameterizedJobMixIn, isParameterized, makeDisabled, scheduleBuild, scheduleBuildMethods inherited from interface hudson.model.PersistenceRoot
getRootDirMethods inherited from interface hudson.model.Queue.Task
checkAbortPermission, getAffinityKey, getCauseOfBlockage, getDefaultAuthentication, getDefaultAuthentication, getDefaultAuthentication2, getDefaultAuthentication2, getName, getSubTasks, getUrl, getWhyBlocked, isBuildBlocked, isConcurrentBuildMethods inherited from interface hudson.model.ResourceActivity
getResourceListMethods inherited from interface jenkins.triggers.SCMTriggerItem
getNextBuildNumber, getQuietPeriod, poll, scheduleBuild2, schedulePollingMethods inherited from interface hudson.search.SearchableModelObject
getSearchMethods inherited from interface hudson.search.SearchItem
getSearchIcon, getSearchIndex, getSearchName, getSearchUrlMethods inherited from interface hudson.model.queue.SubTask
getAssignedLabel, getEstimatedDuration, getLastBuiltOn, getOwnerExecutable, getOwnerTask, getSameNodeConstraint
-
Constructor Details
-
Project
Creates a new project.
-
-
Method Details
-
onLoad
Description copied from class:AbstractItemCalled right after when aItemis loaded from disk. This is an opportunity to do a post load processing.- Specified by:
onLoadin interfaceItem- Overrides:
onLoadin classAbstractProject<P extends Project<P,B>, B extends Build<P, B>> - Parameters:
name- Name of the directory (not a path --- just the name portion) from which the configuration was loaded. This usually becomes thenameof this item.- Throws:
IOException
-
asProject
Description copied from interface:BuildableItemWithBuildWrappersBuildableItemWithBuildWrappersneeds to be an instance ofAbstractProject.This method must be always implemented as
(AbstractProject)this, but defining this method emphasizes the fact that this cast must be doable.- Specified by:
asProjectin interfaceBuildableItemWithBuildWrappers
-
asItem
Description copied from interface:SCMTriggerItemShould bethis.- Specified by:
asItemin interfaceSCMTriggerItem
-
getSCMTrigger
- Specified by:
getSCMTriggerin interfaceSCMTriggerItem
-
getSCMs
Description copied from interface:SCMTriggerItemObtains all active SCMs. May be used for informational purposes, or to determine whether to initiate polling.- Specified by:
getSCMsin interfaceSCMTriggerItem- Returns:
- a possibly empty collection
-
getBuilders
-
getPublishers
Deprecated.as of 1.463 We will be soon removing the restriction that only one instance of publisher is allowed per type. UsegetPublishersList()instead. -
getBuildersList
-
getPublishersList
Description copied from class:AbstractProjectReturns 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.- Specified by:
getPublishersListin classAbstractProject<P extends Project<P,B>, B extends Build<P, B>>
-
getBuildWrappers
-
getBuildWrappersList
Description copied from interface:BuildableItemWithBuildWrappersBuildWrappers associated with thisAbstractProject.- Specified by:
getBuildWrappersListin interfaceBuildableItemWithBuildWrappers- Returns:
- can be empty but never null. This list is live, and changes to it will be reflected to the project configuration.
-
getResourceActivities
Description copied from class:AbstractProjectSet of child resource activities of the build of this project (override in child projects).- Overrides:
getResourceActivitiesin classAbstractProject<P extends Project<P,B>, B extends Build<P, B>> - Returns:
- The set of child resource activities of the build of this project.
-
addPublisher
Deprecated.as of 1.290 UsegetPublishersList().add(x)- Throws:
IOException
-
removePublisher
Deprecated.as of 1.290 UsegetPublishersList().remove(x)Removes a publisher from this project, if it's active.- Throws:
IOException
-
getPublisher
-
buildDependencyGraph
Description copied from class:AbstractProjectBuilds the dependency graph. Since 1.558, not abstract and by default includes dependencies contributed byAbstractProject.triggers().- Overrides:
buildDependencyGraphin classAbstractProject<P extends Project<P,B>, B extends Build<P, B>>
-
isFingerprintConfigured
public boolean isFingerprintConfigured()Description copied from class:AbstractProjectTrue if the builds of this project producesFingerprintrecords.- Specified by:
isFingerprintConfiguredin classAbstractProject<P extends Project<P,B>, B extends Build<P, B>>
-
inferMavenInstallation
Description copied from interface:Maven.ProjectWithMavenGets theMaven.MavenInstallationassociated with the project. Can be null.If the Maven installation can not be uniquely determined, it's often better to return just one of them, rather than returning null, since this method is currently ultimately only used to decide where to parse
conf/settings.xmlfrom.- Specified by:
inferMavenInstallationin interfaceMaven.ProjectWithMaven
-
submit
protected 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 classAbstractProject<P extends Project<P,B>, B extends Build<P, B>> - Throws:
IOExceptionjakarta.servlet.ServletExceptionDescriptor.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 classAbstractProject<P extends Project<P,B>, B extends Build<P, B>> - Throws:
IOExceptionjavax.servlet.ServletExceptionDescriptor.FormException
-
createTransientActions
- Overrides:
createTransientActionsin classAbstractProject<P extends Project<P,B>, B extends Build<P, B>>
-
getPublishersList().add(x)