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,R>
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
,LazyBuildMixIn.LazyLoadingJob<P,
,B> Loadable
,ModelObjectWithChildren
,ModelObjectWithContextMenu
,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.LabelValidator
Nested classes/interfaces inherited from class hudson.model.Job
Job.BuildNumberAssigner, Job.DefaultBuildNumberAssigner, Job.LastItemListener, Job.SubItemBuildsLocationImpl
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
Nested classes/interfaces inherited from interface org.kohsuke.stapler.HttpDeletable
org.kohsuke.stapler.HttpDeletable.HttpDeletableDispatcher
Nested classes/interfaces inherited from interface jenkins.model.ModelObjectWithContextMenu
ModelObjectWithContextMenu.ContextMenu, ModelObjectWithContextMenu.ContextMenuVisibility, ModelObjectWithContextMenu.MenuItem, ModelObjectWithContextMenu.MenuItemType
Nested 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, triggers
Fields inherited from class hudson.model.Job
HISTORY_ADAPTER, nextBuildNumber, properties, runIdMigrator
Fields inherited from class hudson.model.AbstractItem
description, displayName, name, PRONOUN, SKIP_PERMISSION_CHECK, TASK_NOUN
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addPublisher
(Publisher buildStep) Deprecated.asItem()
Should bethis
.AbstractProject<?,
?> BuildableItemWithBuildWrappers
needs to be an instance ofAbstractProject
.protected void
Builds the dependency graph.BuildWrapper
s 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 allPublisher
s 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.MavenInstallation
associated with the project.boolean
True if the builds of this project producesFingerprint
records.void
Called right after when aItem
is loaded from disk.void
removePublisher
(Descriptor<Publisher> descriptor) Deprecated.as of 1.290 UsegetPublishersList().remove(x)
protected void
submit
(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) Derived class can override this to perform additional config submission work.protected void
submit
(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, updateTransientActions
Methods 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, getDynamic, getEstimatedDuration, getLastBuildsOverThreshold, getLastCompletedBuild, getLastFailedBuild, getLastStableBuild, getLastSuccessfulBuild, getLastUnstableBuild, getLastUnsuccessfulBuild, getLogRotator, getNewBuilds, getNextBuildNumber, getOverrides, getPermalinks, getProperties, getProperty, getProperty, getSearchIcon, getTimeline, isBuilding, isHoldOffBuildUntilSave, isKeepDependencies, isLogUpdated, isNameEditable, logRotate, movedTo, onCopiedFrom, removeProperty, removeProperty, renameTo, saveNextBuildNumber, setBuildDiscarder, setLogRotator, supportsLogRotator, updateNextBuildNumber
Methods 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, writeReplace
Methods inherited from class hudson.model.Actionable
addAction, addOrReplaceAction, doContextMenu, doContextMenu, getAction, getAction, getActions, getAllActions, removeAction, removeActions, replaceAction, replaceActions
Methods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError, sendError, sendError, sendError
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface hudson.security.AccessControlled
checkAnyPermission, checkPermission, getACL, hasAnyPermission, hasPermission, hasPermission, hasPermission2
Methods inherited from interface hudson.model.BuildableItem
scheduleBuild, scheduleBuild
Methods inherited from interface hudson.model.DescriptorByNameOwner
getDescriptorByName
Methods inherited from interface jenkins.widgets.HasWidgets
getWidget, getWidgets
Methods inherited from interface jenkins.model.queue.ITask
hasAbortPermission, hasReadPermission
Methods inherited from interface hudson.model.Item
delete, getAbsoluteUrl, getAllJobs, getDisplayName, getFullDisplayName, getFullName, getName, getParent, getRelativeNameFrom, getRelativeNameFrom, getShortUrl, getUrl, onCopiedFrom, onCreatedFromScratch, save
Methods inherited from interface jenkins.model.ParameterizedJobMixIn.ParameterizedJob
doBuild, doBuild, doBuildWithParameters, doBuildWithParameters, doCancelQueue, doDisable, doEnable, getParameterizedJobMixIn, isParameterized, makeDisabled, scheduleBuild, scheduleBuild
Methods inherited from interface hudson.model.PersistenceRoot
getRootDir
Methods inherited from interface hudson.model.Queue.Task
checkAbortPermission, getAffinityKey, getCauseOfBlockage, getDefaultAuthentication, getDefaultAuthentication, getDefaultAuthentication2, getDefaultAuthentication2, getFullDisplayName, getName, getSubTasks, getUrl, getWhyBlocked, isBuildBlocked, isConcurrentBuild
Methods inherited from interface hudson.model.ResourceActivity
getDisplayName, getResourceList
Methods inherited from interface jenkins.triggers.SCMTriggerItem
getNextBuildNumber, getQuietPeriod, poll, scheduleBuild2, schedulePolling
Methods inherited from interface hudson.search.SearchableModelObject
getSearch
Methods inherited from interface hudson.search.SearchItem
getSearchIcon, getSearchIndex, getSearchName, getSearchUrl
Methods 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:AbstractItem
Called right after when aItem
is loaded from disk. This is an opportunity to do a post load processing. -
asProject
Description copied from interface:BuildableItemWithBuildWrappers
BuildableItemWithBuildWrappers
needs 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:
asProject
in interfaceBuildableItemWithBuildWrappers
-
asItem
Description copied from interface:SCMTriggerItem
Should bethis
.- Specified by:
asItem
in interfaceSCMTriggerItem
-
getSCMTrigger
- Specified by:
getSCMTrigger
in interfaceSCMTriggerItem
-
getSCMs
Description copied from interface:SCMTriggerItem
Obtains all active SCMs. May be used for informational purposes, or to determine whether to initiate polling.- Specified by:
getSCMs
in 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:AbstractProject
Returns the live list of allPublisher
s configured for this project.This method couldn't be called
getPublishers()
because existing methods in sub-classes return different inconsistent types.- Specified by:
getPublishersList
in classAbstractProject<P extends Project<P,
B>, B extends Build<P, B>>
-
getBuildWrappers
-
getBuildWrappersList
Description copied from interface:BuildableItemWithBuildWrappers
BuildWrapper
s associated with thisAbstractProject
.- Specified by:
getBuildWrappersList
in 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:AbstractProject
Set of child resource activities of the build of this project (override in child projects).- Overrides:
getResourceActivities
in 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:AbstractProject
Builds the dependency graph. Since 1.558, not abstract and by default includes dependencies contributed byAbstractProject.triggers()
.- Overrides:
buildDependencyGraph
in classAbstractProject<P extends Project<P,
B>, B extends Build<P, B>>
-
isFingerprintConfigured
public boolean isFingerprintConfigured()Description copied from class:AbstractProject
True if the builds of this project producesFingerprint
records.- Specified by:
isFingerprintConfigured
in classAbstractProject<P extends Project<P,
B>, B extends Build<P, B>>
-
inferMavenInstallation
Description copied from interface:Maven.ProjectWithMaven
Gets theMaven.MavenInstallation
associated 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.xml
from.- Specified by:
inferMavenInstallation
in 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:Job
Derived class can override this to perform additional config submission work.- Overrides:
submit
in classAbstractProject<P extends Project<P,
B>, B extends Build<P, B>> - 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:
submit
in classAbstractProject<P extends Project<P,
B>, B extends Build<P, B>> - Throws:
IOException
javax.servlet.ServletException
Descriptor.FormException
-
createTransientActions
- Overrides:
createTransientActions
in classAbstractProject<P extends Project<P,
B>, B extends Build<P, B>>
-
getPublishersList().add(x)