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.MavenModuleDependencyNested 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.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.MenuItemType -
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, properties, runIdMigratorFields inherited from class hudson.model.AbstractItem
description, name, PRONOUN, SKIP_PERMISSION_CHECK, TASK_NOUN -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddTransientActionsFromBuild(MavenBuild build, List<Action> collection, Set<Class> added) Gets groupId+artifactId+version asModuleDependency.protected voidprotected List<MavenReporter>Creates a list ofMavenReporters to be used for a build of this project.protected voidprotected Collection<MavenModule>Returns all Maven modules in this Jenkins instance.Short-cut forgetModuleName().artifactIdMavenModuleuses 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 ofModuleDependencygetGoals()Gets the list of goals to execute for this module.Short-cut forgetModuleName().groupIdgetJDK()MavenModulefollows 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 activeMavenReporters configured for this module.Computes the list ofMavenModules 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.booleanbooleanbooleanbooleanisSameModule(hudson.maven.PomInfo pom) Returns if the given POM likely describes the same module with the same dependencies.protected MavenBuildnewBuild()voidprotected voidvoidsetLogRotator(LogRotator logRotator) Deprecated.Not allowed to configure log rotation per module.protected voidsubmit(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) booleantoString()for debug purposeprotected voidMethods inherited from class hudson.maven.AbstractMavenProject
createTransientActions, scheduleBuild, scheduleBuild, scheduleBuild, scheduleBuildMethods 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, 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, submit, supportsMakeDisabled, triggersMethods 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, getNewBuilds, getNextBuildNumber, getOverrides, getPermalinks, getProperties, getProperty, getProperty, getTimeline, isBuilding, isHoldOffBuildUntilSave, isKeepDependencies, isLogUpdated, logRotate, movedTo, onCopiedFrom, removeProperty, removeProperty, renameTo, saveNextBuildNumber, setBuildDiscarder, updateNextBuildNumberMethods inherited from class hudson.model.AbstractItem
delete, delete, doCheckNewName, doConfigDotXml, doConfigDotXml, doConfirmRename, doDoDelete, doDoDelete, doReload, doSubmitDescription, doSubmitDescription, getAbsoluteUrl, getApi, getConfigFile, getDescription, getDisplayNameOrNull, getFullDisplayName, getFullName, getName, getRelativeDisplayNameFrom, getRelativeNameFromGroup, getRootDir, getSearchName, getSearchUrl, getTarget, getTaskNoun, getUrl, load, setDescription, setDisplayName, setDisplayNameOrNull, updateByXml, updateByXml, writeConfigDotXml, writeReplaceMethods inherited from class hudson.model.Actionable
addAction, addOrReplaceAction, doContextMenu, doContextMenu, getAction, getAction, getActions, getAllActions, 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.DescriptorByNameOwner
getDescriptorByNameMethods inherited from interface jenkins.widgets.HasWidgets
getWidget, getWidgetsMethods inherited from interface hudson.model.Item
delete, getAbsoluteUrl, getAllJobs, getFullDisplayName, getFullName, getName, getRelativeNameFrom, getRelativeNameFrom, getUrl, onCopiedFromMethods inherited from interface jenkins.model.ParameterizedJobMixIn.ParameterizedJob
doBuild, doBuild, doBuildWithParameters, doBuildWithParameters, doCancelQueue, doDisable, doEnable, getParameterizedJobMixIn, isParameterized, makeDisabledMethods inherited from interface hudson.model.PersistenceRoot
getRootDirMethods inherited from interface hudson.model.Queue.Task
getAffinityKey, getDefaultAuthentication, getDefaultAuthentication, getDefaultAuthentication2, getDefaultAuthentication2, getFullDisplayName, getName, getUrl, getWhyBlocked, isBuildBlockedMethods inherited from interface hudson.search.SearchableModelObject
getSearchMethods inherited from interface hudson.search.SearchItem
getSearchIndex, getSearchName, getSearchUrlMethods inherited from interface hudson.model.queue.SubTask
getEstimatedDuration, getOwnerExecutable, getOwnerTask
-
Method Details
-
getLogRotator
MavenModulefollows the same log rotation schedule as its parent.- Overrides:
getLogRotatorin classJob<MavenModule,MavenBuild>
-
setLogRotator
Deprecated.Not allowed to configure log rotation per module.- Overrides:
setLogRotatorin classJob<MavenModule,MavenBuild>
-
supportsLogRotator
public boolean supportsLogRotator()- Overrides:
supportsLogRotatorin classJob<MavenModule,MavenBuild>
-
isBuildable
public boolean isBuildable()- Specified by:
isBuildablein interfaceParameterizedJobMixIn.ParameterizedJob<MavenModule,MavenBuild> - Overrides:
isBuildablein classAbstractProject<MavenModule,MavenBuild>
-
getSubsidiaries
Computes the list ofMavenModules 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:
doSetNamein classAbstractItem
-
onLoad
- Specified by:
onLoadin interfaceItem- Overrides:
onLoadin 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:
getPublishersListin classAbstractProject<MavenModule,MavenBuild>
-
getJDK
- Overrides:
getJDKin classAbstractProject<MavenModule,MavenBuild>
-
getBuildClass
- Specified by:
getBuildClassin classAbstractProject<MavenModule,MavenBuild>
-
newBuild
- Overrides:
newBuildin classAbstractProject<MavenModule,MavenBuild> - Throws:
IOException
-
getModuleName
-
asDependency
Gets groupId+artifactId+version asModuleDependency. -
getShortUrl
- Specified by:
getShortUrlin interfaceItem- Overrides:
getShortUrlin classAbstractItem
-
getDisplayName
- Specified by:
getDisplayNamein interfaceItem- Specified by:
getDisplayNamein interfaceModelObject- Specified by:
getDisplayNamein interfaceResourceActivity- Overrides:
getDisplayNamein classAbstractItem
-
getPronoun
- Overrides:
getPronounin classAbstractProject<MavenModule,MavenBuild>
-
isNameEditable
public boolean isNameEditable()- Overrides:
isNameEditablein classJob<MavenModule,MavenBuild>
-
getParent
- Specified by:
getParentin interfaceItem- Overrides:
getParentin 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
MavenModuleuses the workspace of theMavenModuleSet, so it always needs to be built on the same agent as the parent.- Specified by:
getAssignedLabelin interfaceSubTask- Overrides:
getAssignedLabelin classAbstractProject<MavenModule,MavenBuild>
-
getWorkspaceResource
Deprecated.as of 1.319 inAbstractProject.Workspace of aMavenModuleis a part of the parent's workspace.That is,
MavenModuleSetbuilds are incompatible with anyMavenModulebuilds, whereasMavenModulebuilds are compatible with each other.- Overrides:
getWorkspaceResourcein classAbstractProject<MavenModule,MavenBuild>
-
isFingerprintConfigured
public boolean isFingerprintConfigured()- Specified by:
isFingerprintConfiguredin classAbstractProject<MavenModule,MavenBuild>
-
updateTransientActions
protected void updateTransientActions()- Overrides:
updateTransientActionsin classAbstractProject<MavenModule,MavenBuild>
-
buildDependencyGraph
- Overrides:
buildDependencyGraphin 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:
addTransientActionsFromBuildin classAbstractMavenProject<MavenModule,MavenBuild> collection- Add the transient actions to this collection.
-
inferMavenInstallation
- Specified by:
inferMavenInstallationin interfaceMaven.ProjectWithMaven
-
getReporters
List of activeMavenReporters configured for this module. -
submit
protected void submit(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) throws IOException, jakarta.servlet.ServletException, Descriptor.FormException - Overrides:
submitin classAbstractProject<MavenModule,MavenBuild> - Throws:
IOExceptionjakarta.servlet.ServletExceptionDescriptor.FormException
-
performDelete
- Overrides:
performDeletein classAbstractProject<MavenModule,MavenBuild> - Throws:
IOExceptionInterruptedException
-
createReporters
Creates a list ofMavenReporters to be used for a build of this project. -
getDependencies
defensive copy ofModuleDependency- Since:
- 2.2
-
toString
for debug purpose- Overrides:
toStringin classAbstractItem
-
AbstractProject.