Package hudson.maven
Class MavenModule
- All Implemented Interfaces:
ExtensionPoint
,BuildableItem
,DescriptorByNameOwner
,Item
,ModelObject
,PersistenceRoot
,SubTask
,Queue.Task
,ResourceActivity
,Saveable
,SearchableModelObject
,SearchItem
,AccessControlled
,Maven.ProjectWithMaven
,LazyBuildMixIn.LazyLoadingJob<MavenModule,
,MavenBuild> Loadable
,ModelObjectWithChildren
,ModelObjectWithContextMenu
,ParameterizedJobMixIn.ParameterizedJob<MavenModule,
,MavenBuild> TriggeredItem
,OnMaster
,HasWidgets
,org.kohsuke.stapler.HttpDeletable
,org.kohsuke.stapler.StaplerOverridable
,org.kohsuke.stapler.StaplerProxy
Job
that builds projects based on Maven2.- Author:
- Kohsuke Kawaguchi
-
Nested Class Summary
Nested classes/interfaces inherited from class hudson.maven.AbstractMavenProject
AbstractMavenProject.MavenModuleDependency
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
-
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, name, PRONOUN, SKIP_PERMISSION_CHECK, TASK_NOUN
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
addTransientActionsFromBuild
(MavenBuild build, List<Action> collection, Set<Class> added) Gets groupId+artifactId+version asModuleDependency
.protected void
protected List<MavenReporter>
Creates a list ofMavenReporter
s to be used for a build of this project.protected void
protected Collection<MavenModule>
Returns all Maven modules in this Jenkins instance.Short-cut forgetModuleName().artifactId
MavenModule
uses the workspace of theMavenModuleSet
, so it always needs to be built on the same agent as the parent.protected Class<MavenBuild>
Gets all the child modules (that are listed in the<module>
element in our POM).defensive copy ofModuleDependency
getGoals()
Gets the list of goals to execute for this module.Short-cut forgetModuleName().groupId
getJDK()
MavenModule
follows the same log rotation schedule as its parent.Packaging type of the module.Relative path to this module's root directory from the workspace of aMavenModuleSet
.List of activeMavenReporter
s configured for this module.Computes the list ofMavenModule
s that are 'under' this POM filesystem-wise.Gets the list of goals specified by the user, without taking inheritance and POM default goals into account.Gets the version number in Maven POM as of the last build.Deprecated.boolean
boolean
boolean
boolean
isSameModule
(hudson.maven.PomInfo pom) Returns if the given POM likely describes the same module with the same dependencies.protected MavenBuild
newBuild()
void
protected void
void
setLogRotator
(LogRotator logRotator) Deprecated.Not allowed to configure log rotation per module.protected void
submit
(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) boolean
toString()
for debug purposeprotected void
Methods inherited from class hudson.maven.AbstractMavenProject
createTransientActions, scheduleBuild, scheduleBuild, scheduleBuild, scheduleBuild
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, getAssignedLabelString, getAuthToken, getBuild, getBuildByNumber, getBuildingDownstream, getBuildingUpstream, getBuildNowText, getBuildTriggerUpstreamProjects, getCauseOfBlockage, getCustomWorkspace, getDelay, getDownstreamProjects, getDownstreamProjectsForApi, getEnvironment, getEstimatedDurationCandidates, getFirstBuild, getHasCustomQuietPeriod, getIconColor, getLastBuild, getLastBuiltOn, getLazyBuildMixIn, getModuleRoot, getModuleRoots, getNearestBuild, getNearestOldBuild, getProminentActions, getQueueItem, getQuietPeriod, getRelationship, getRelevantLabels, getResourceActivities, getResourceList, getRootProject, getSameNodeConstraint, getScm, getScmCheckoutRetryCount, getScmCheckoutStrategy, getSomeBuildWithWorkspace, getSomeWorkspace, getSubTasks, getTransitiveDownstreamProjects, getTransitiveUpstreamProjects, getTrigger, getTriggers, getUpstreamProjects, getUpstreamProjectsForApi, getWorkspace, hasAbortPermission, hasCustomScmCheckoutRetryCount, hasParticipant, isConcurrentBuild, isConfigurable, isDisabled, isInQueue, loadBuild, makeSearchIndex, onCreatedFromScratch, 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
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, getLastBuildsOverThreshold, getLastCompletedBuild, getLastFailedBuild, getLastStableBuild, getLastSuccessfulBuild, getLastUnstableBuild, getLastUnsuccessfulBuild, getNewBuilds, getNextBuildNumber, getOverrides, getPermalinks, getProperties, getProperty, getProperty, getTimeline, isBuilding, isHoldOffBuildUntilSave, isKeepDependencies, isLogUpdated, logRotate, movedTo, onCopiedFrom, removeProperty, removeProperty, renameTo, saveNextBuildNumber, setBuildDiscarder, updateNextBuildNumber
Methods inherited from class hudson.model.AbstractItem
delete, doCheckNewName, doConfigDotXml, doConfirmRename, doDoDelete, doReload, doSubmitDescription, getAbsoluteUrl, getApi, getConfigFile, getDescription, getDisplayNameOrNull, getFullDisplayName, getFullName, getName, getRelativeDisplayNameFrom, getRelativeNameFromGroup, getRootDir, getSearchName, getSearchUrl, getTarget, getTaskNoun, getUrl, load, setDescription, setDisplayName, setDisplayNameOrNull, 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.DescriptorByNameOwner
getDescriptorByName
Methods inherited from interface jenkins.widgets.HasWidgets
getWidget, getWidgets
Methods inherited from interface hudson.model.Item
delete, getAbsoluteUrl, getAllJobs, getFullDisplayName, getFullName, getName, getRelativeNameFrom, getRelativeNameFrom, getUrl, onCopiedFrom
Methods inherited from interface jenkins.model.ParameterizedJobMixIn.ParameterizedJob
doBuild, doBuildWithParameters, doCancelQueue, doDisable, doEnable, getParameterizedJobMixIn, isParameterized, makeDisabled
Methods inherited from interface hudson.model.PersistenceRoot
getRootDir
Methods inherited from interface hudson.model.Queue.Task
getAffinityKey, getDefaultAuthentication, getDefaultAuthentication, getDefaultAuthentication2, getDefaultAuthentication2, getFullDisplayName, getName, getUrl, getWhyBlocked, isBuildBlocked
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
getEstimatedDuration, getOwnerExecutable, getOwnerTask
-
Method Details
-
getLogRotator
MavenModule
follows the same log rotation schedule as its parent.- Overrides:
getLogRotator
in classJob<MavenModule,
MavenBuild>
-
setLogRotator
Deprecated.Not allowed to configure log rotation per module.- Overrides:
setLogRotator
in classJob<MavenModule,
MavenBuild>
-
supportsLogRotator
public boolean supportsLogRotator()- Overrides:
supportsLogRotator
in classJob<MavenModule,
MavenBuild>
-
isBuildable
public boolean isBuildable()- Specified by:
isBuildable
in interfaceParameterizedJobMixIn.ParameterizedJob<MavenModule,
MavenBuild> - Overrides:
isBuildable
in classAbstractProject<MavenModule,
MavenBuild>
-
getSubsidiaries
Computes the list ofMavenModule
s that are 'under' this POM filesystem-wise. The list doens't include this module itself.Note that this doesn't necessary has anything to do with the module inheritance structure or parent/child relationship of the POM.
-
isSameModule
public boolean isSameModule(hudson.maven.PomInfo pom) Returns if the given POM likely describes the same module with the same dependencies. Implementation needs not be 100% accurate in the true case, but it MUST return false if is not the same. -
doSetName
- Overrides:
doSetName
in classAbstractItem
-
onLoad
- Specified by:
onLoad
in interfaceItem
- Overrides:
onLoad
in classAbstractProject<MavenModule,
MavenBuild> - Throws:
IOException
-
getRelativePath
Relative path to this module's root directory from the workspace of aMavenModuleSet
. The path separator is normalized to '/'. -
getVersion
Gets the version number in Maven POM as of the last build.- Returns:
- This method can return null if Jenkins loaded old data that didn't record this information, so that situation needs to be handled gracefully.
- Since:
- 1.199
-
getPackaging
Packaging type of the module. pom, jar, maven-plugin, ejb, war, ear, rar, par or other custom types.- Since:
- 2.1
-
getGroupId
Short-cut forgetModuleName().groupId
- Since:
- 2.1
-
getArtifactId
Short-cut forgetModuleName().artifactId
- Since:
- 2.1
-
getGoals
Gets the list of goals to execute for this module. -
getUserConfiguredGoals
Gets the list of goals specified by the user, without taking inheritance and POM default goals into account.This is only used to present the UI screen, and in all the other cases
getGoals()
should be used. -
getPublishersList
- Specified by:
getPublishersList
in classAbstractProject<MavenModule,
MavenBuild>
-
getJDK
- Overrides:
getJDK
in classAbstractProject<MavenModule,
MavenBuild>
-
getBuildClass
- Specified by:
getBuildClass
in classAbstractProject<MavenModule,
MavenBuild>
-
newBuild
- Overrides:
newBuild
in classAbstractProject<MavenModule,
MavenBuild> - Throws:
IOException
-
getModuleName
-
asDependency
Gets groupId+artifactId+version asModuleDependency
. -
getShortUrl
- Specified by:
getShortUrl
in interfaceItem
- Overrides:
getShortUrl
in classAbstractItem
-
getDisplayName
- Specified by:
getDisplayName
in interfaceItem
- Specified by:
getDisplayName
in interfaceModelObject
- Specified by:
getDisplayName
in interfaceResourceActivity
- Overrides:
getDisplayName
in classAbstractItem
-
getPronoun
- Overrides:
getPronoun
in classAbstractProject<MavenModule,
MavenBuild>
-
isNameEditable
public boolean isNameEditable()- Overrides:
isNameEditable
in classJob<MavenModule,
MavenBuild>
-
getParent
- Specified by:
getParent
in interfaceItem
- Overrides:
getParent
in classAbstractItem
-
getChildren
Gets all the child modules (that are listed in the<module>
element in our POM).This method returns null if this information is not recorded. This happens for compatibility reason.
- Since:
- 1.133
-
getAssignedLabel
MavenModule
uses the workspace of theMavenModuleSet
, so it always needs to be built on the same agent as the parent.- Specified by:
getAssignedLabel
in interfaceSubTask
- Overrides:
getAssignedLabel
in classAbstractProject<MavenModule,
MavenBuild>
-
getWorkspaceResource
Deprecated.as of 1.319 inAbstractProject
.Workspace of aMavenModule
is a part of the parent's workspace.That is,
MavenModuleSet
builds are incompatible with anyMavenModule
builds, whereasMavenModule
builds are compatible with each other.- Overrides:
getWorkspaceResource
in classAbstractProject<MavenModule,
MavenBuild>
-
isFingerprintConfigured
public boolean isFingerprintConfigured()- Specified by:
isFingerprintConfigured
in classAbstractProject<MavenModule,
MavenBuild>
-
updateTransientActions
protected void updateTransientActions()- Overrides:
updateTransientActions
in classAbstractProject<MavenModule,
MavenBuild>
-
buildDependencyGraph
- Overrides:
buildDependencyGraph
in classAbstractProject<MavenModule,
MavenBuild>
-
getAllMavenModules
Returns all Maven modules in this Jenkins instance. -
addTransientActionsFromBuild
protected void addTransientActionsFromBuild(MavenBuild build, List<Action> collection, Set<Class> added) - Specified by:
addTransientActionsFromBuild
in classAbstractMavenProject<MavenModule,
MavenBuild> collection
- Add the transient actions to this collection.
-
inferMavenInstallation
- Specified by:
inferMavenInstallation
in interfaceMaven.ProjectWithMaven
-
getReporters
List of activeMavenReporter
s configured for this module. -
submit
protected void submit(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException, javax.servlet.ServletException, Descriptor.FormException - Overrides:
submit
in classAbstractProject<MavenModule,
MavenBuild> - Throws:
IOException
javax.servlet.ServletException
Descriptor.FormException
-
performDelete
- Overrides:
performDelete
in classAbstractProject<MavenModule,
MavenBuild> - Throws:
IOException
InterruptedException
-
createReporters
Creates a list ofMavenReporter
s to be used for a build of this project. -
getDependencies
defensive copy ofModuleDependency
- Since:
- 2.2
-
toString
for debug purpose- Overrides:
toString
in classAbstractItem
-
AbstractProject
.