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>,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.LastItemListener, Job.SubItemBuildsLocationImpl
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
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
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddPublisher(Publisher buildStep)Deprecated.as of 1.290 UsegetPublishersList().add(x)ItemasItem()Should bethis.AbstractProject<?,?>asProject()BuildableItemWithBuildWrappersneeds to be an instance ofAbstractProject.protected voidbuildDependencyGraph(DependencyGraph graph)Builds the dependency graph.protected List<Action>createTransientActions()List<Builder>getBuilders()DescribableList<Builder,Descriptor<Builder>>getBuildersList()Map<Descriptor<BuildWrapper>,BuildWrapper>getBuildWrappers()DescribableList<BuildWrapper,Descriptor<BuildWrapper>>getBuildWrappersList()BuildWrappers associated with thisAbstractProject.PublishergetPublisher(Descriptor<Publisher> descriptor)Map<Descriptor<Publisher>,Publisher>getPublishers()Deprecated.as of 1.463 We will be soon removing the restriction that only one instance of publisher is allowed per type.DescribableList<Publisher,Descriptor<Publisher>>getPublishersList()Returns the live list of allPublishers configured for this project.protected Set<ResourceActivity>getResourceActivities()Set of child resource activities of the build of this project (override in child projects).Collection<? extends SCM>getSCMs()Obtains all active SCMs.SCMTriggergetSCMTrigger()Maven.MavenInstallationinferMavenInstallation()Gets theMaven.MavenInstallationassociated with the project.booleanisFingerprintConfigured()True if the builds of this project producesFingerprintrecords.voidonLoad(ItemGroup<? extends Item> parent, String name)Called right after when aItemis loaded from disk.voidremovePublisher(Descriptor<Publisher> descriptor)Deprecated.as of 1.290 UsegetPublishersList().remove(x)protected voidsubmit(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)Derived class can override this to perform additional config submission work.-
Methods inherited from class hudson.model.AbstractProject
_getRuns, addProperty, addToList, addTrigger, blockBuildWhenDownstreamBuilding, blockBuildWhenUpstreamBuilding, buildDescribable, buildDescribable, checkAbortPermission, checkout, createExecutable, createHistoryWidget, 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, delete, doBuildStatus, 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, getLastBuildsOverThreshold, getLastCompletedBuild, getLastFailedBuild, getLastStableBuild, getLastSuccessfulBuild, getLastUnstableBuild, getLastUnsuccessfulBuild, getLogRotator, getNewBuilds, getNextBuildNumber, getOverrides, getPermalinks, getProperties, getProperty, getProperty, 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, doCheckNewName, doConfigDotXml, doConfirmRename, doDoDelete, doReload, doSetName, 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, getAction, getAction, getActions, getAllActions, removeAction, removeActions, replaceAction, replaceActions
-
Methods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, requirePOST, 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 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, 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, hasAbortPermission, 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
getSearchIndex, getSearchName, getSearchUrl
-
Methods inherited from interface hudson.model.queue.SubTask
getAssignedLabel, getEstimatedDuration, getLastBuiltOn, getOwnerExecutable, getOwnerTask, getSameNodeConstraint
-
-
-
-
Method Detail
-
onLoad
public void onLoad(ItemGroup<? extends Item> parent, String name) throws IOException
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>>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
public AbstractProject<?,?> 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
public Item asItem()
Description copied from interface:SCMTriggerItemShould bethis.- Specified by:
asItemin interfaceSCMTriggerItem
-
getSCMTrigger
public SCMTrigger getSCMTrigger()
- Specified by:
getSCMTriggerin interfaceSCMTriggerItem
-
getSCMs
public Collection<? extends SCM> 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
-
getPublishers
@Deprecated public Map<Descriptor<Publisher>,Publisher> 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
public DescribableList<Builder,Descriptor<Builder>> getBuildersList()
-
getPublishersList
public DescribableList<Publisher,Descriptor<Publisher>> 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
public Map<Descriptor<BuildWrapper>,BuildWrapper> getBuildWrappers()
-
getBuildWrappersList
public DescribableList<BuildWrapper,Descriptor<BuildWrapper>> 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
protected Set<ResourceActivity> 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 public void addPublisher(Publisher buildStep) throws IOException
Deprecated.as of 1.290 UsegetPublishersList().add(x)- Throws:
IOException
-
removePublisher
@Deprecated public void removePublisher(Descriptor<Publisher> descriptor) throws IOException
Deprecated.as of 1.290 UsegetPublishersList().remove(x)Removes a publisher from this project, if it's active.- Throws:
IOException
-
getPublisher
public Publisher getPublisher(Descriptor<Publisher> descriptor)
-
buildDependencyGraph
protected void buildDependencyGraph(DependencyGraph graph)
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
public Maven.MavenInstallation 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.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException, javax.servlet.ServletException, Descriptor.FormExceptionDescription 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:
IOExceptionjavax.servlet.ServletExceptionDescriptor.FormException
-
-