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>
,ModelObjectWithChildren
,ModelObjectWithContextMenu
,ParameterizedJobMixIn.ParameterizedJob<P,B>
,SCMTriggerItem
,TriggeredItem
,OnMaster
,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 void
addPublisher(Publisher buildStep)
Deprecated.as of 1.290 UsegetPublishersList().add(x)
Item
asItem()
Should bethis
.AbstractProject<?,?>
asProject()
BuildableItemWithBuildWrappers
needs to be an instance ofAbstractProject
.protected void
buildDependencyGraph(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()
BuildWrapper
s associated with thisAbstractProject
.Publisher
getPublisher(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 allPublisher
s 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.SCMTrigger
getSCMTrigger()
Maven.MavenInstallation
inferMavenInstallation()
Gets theMaven.MavenInstallation
associated with the project.boolean
isFingerprintConfigured()
True if the builds of this project producesFingerprint
records.void
onLoad(ItemGroup<? extends Item> parent, String name)
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.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, 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, getACL, getAllJobs, getAllProperties, getBuildDir, getBuildDiscarder, getBuildForCLI, getBuildHealth, getBuildHealthReports, getBuilds, getBuilds, getBuildsAsMap, getBuildsByTimestamp, getBuildStatusIconClassName, getBuildStatusUrl, getBuildTimeGraph, getCharacteristicEnvVars, getDynamic, getEstimatedDuration, getEstimatedDurationCandidates, getLastBuildsOverThreshold, getLastCompletedBuild, getLastFailedBuild, getLastStableBuild, getLastSuccessfulBuild, getLastUnstableBuild, getLastUnsuccessfulBuild, getLogRotator, getNewBuilds, getNextBuildNumber, getOverrides, getPermalinks, getProperties, getProperty, getProperty, getTimeline, getWidgets, 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, 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 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:AbstractItem
Called right after when aItem
is loaded from disk. This is an opportunity to do a post load processing.- Specified by:
onLoad
in interfaceItem
- Overrides:
onLoad
in 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 thename
of this item.- Throws:
IOException
-
asProject
public AbstractProject<?,?> 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
public Item asItem()
Description copied from interface:SCMTriggerItem
Should bethis
.- Specified by:
asItem
in interfaceSCMTriggerItem
-
getSCMTrigger
public SCMTrigger getSCMTrigger()
- Specified by:
getSCMTrigger
in interfaceSCMTriggerItem
-
getSCMs
public Collection<? extends SCM> 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
-
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: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
public Map<Descriptor<BuildWrapper>,BuildWrapper> getBuildWrappers()
-
getBuildWrappersList
public DescribableList<BuildWrapper,Descriptor<BuildWrapper>> 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
protected Set<ResourceActivity> 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 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: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
public Maven.MavenInstallation 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.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException, javax.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
javax.servlet.ServletException
Descriptor.FormException
-
-