Package hudson.maven
Class MavenModule
- java.lang.Object
-
- hudson.model.AbstractModelObject
-
- hudson.model.Actionable
-
- hudson.model.AbstractItem
-
- hudson.model.Job<P,R>
-
- hudson.model.AbstractProject<P,R>
-
- hudson.maven.AbstractMavenProject<MavenModule,MavenBuild>
-
- hudson.maven.MavenModule
-
- All Implemented Interfaces:
ExtensionPoint
,BuildableItem
,DescriptorByNameOwner
,Item
,ModelObject
,PersistenceRoot
,SubTask
,Queue.Task
,ResourceActivity
,Saveable
,SearchableModelObject
,SearchItem
,AccessControlled
,Maven.ProjectWithMaven
,LazyBuildMixIn.LazyLoadingJob<MavenModule,MavenBuild>
,ModelObjectWithChildren
,ModelObjectWithContextMenu
,ParameterizedJobMixIn.ParameterizedJob<MavenModule,MavenBuild>
,TriggeredItem
,OnMaster
,org.kohsuke.stapler.HttpDeletable
,org.kohsuke.stapler.StaplerOverridable
,org.kohsuke.stapler.StaplerProxy
public class MavenModule extends AbstractMavenProject<MavenModule,MavenBuild> implements Saveable
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
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected void
addTransientActionsFromBuild(MavenBuild build, List<Action> collection, Set<Class> added)
ModuleDependency
asDependency()
Gets groupId+artifactId+version asModuleDependency
.protected void
buildDependencyGraph(DependencyGraph graph)
protected List<MavenReporter>
createReporters()
Creates a list ofMavenReporter
s to be used for a build of this project.protected void
doSetName(String name)
protected Collection<MavenModule>
getAllMavenModules()
Returns all Maven modules in this Jenkins instance.String
getArtifactId()
Short-cut forgetModuleName().artifactId
Label
getAssignedLabel()
MavenModule
uses the workspace of theMavenModuleSet
, so it always needs to be built on the same agent as the parent.protected Class<MavenBuild>
getBuildClass()
List<MavenModule>
getChildren()
Gets all the child modules (that are listed in the<module>
element in our POM).Set<ModuleDependency>
getDependencies()
defensive copy ofModuleDependency
String
getDisplayName()
String
getGoals()
Gets the list of goals to execute for this module.String
getGroupId()
Short-cut forgetModuleName().groupId
JDK
getJDK()
LogRotator
getLogRotator()
MavenModule
follows the same log rotation schedule as its parent.ModuleName
getModuleName()
String
getPackaging()
Packaging type of the module.MavenModuleSet
getParent()
String
getPronoun()
DescribableList<Publisher,Descriptor<Publisher>>
getPublishersList()
String
getRelativePath()
Relative path to this module's root directory from the workspace of aMavenModuleSet
.DescribableList<MavenReporter,Descriptor<MavenReporter>>
getReporters()
List of activeMavenReporter
s configured for this module.String
getShortUrl()
List<MavenModule>
getSubsidiaries()
Computes the list ofMavenModule
s that are 'under' this POM filesystem-wise.String
getUserConfiguredGoals()
Gets the list of goals specified by the user, without taking inheritance and POM default goals into account.String
getVersion()
Gets the version number in Maven POM as of the last build.Resource
getWorkspaceResource()
Deprecated.as of 1.319 inAbstractProject
.Maven.MavenInstallation
inferMavenInstallation()
boolean
isBuildable()
boolean
isFingerprintConfigured()
boolean
isNameEditable()
boolean
isSameModule(hudson.maven.PomInfo pom)
Returns if the given POM likely describes the same module with the same dependencies.protected MavenBuild
newBuild()
void
onLoad(ItemGroup<? extends Item> parent, String name)
protected void
performDelete()
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
supportsLogRotator()
String
toString()
for debug purposeprotected void
updateTransientActions()
-
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, 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, getEstimatedDurationCandidates, getLastBuildsOverThreshold, getLastCompletedBuild, getLastFailedBuild, getLastStableBuild, getLastSuccessfulBuild, getLastUnstableBuild, getLastUnsuccessfulBuild, getNewBuilds, getNextBuildNumber, getOverrides, getPermalinks, getProperties, getProperty, getProperty, getTimeline, getWidgets, 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, 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 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, getOwnerTask
-
-
-
-
Method Detail
-
getLogRotator
public LogRotator getLogRotator()
MavenModule
follows the same log rotation schedule as its parent.- Overrides:
getLogRotator
in classJob<MavenModule,MavenBuild>
-
setLogRotator
public void setLogRotator(LogRotator logRotator)
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
public List<MavenModule> 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
protected void doSetName(String name)
- Overrides:
doSetName
in classAbstractItem
-
onLoad
public void onLoad(ItemGroup<? extends Item> parent, String name) throws IOException
- Specified by:
onLoad
in interfaceItem
- Overrides:
onLoad
in classAbstractProject<MavenModule,MavenBuild>
- Throws:
IOException
-
getRelativePath
public String getRelativePath()
Relative path to this module's root directory from the workspace of aMavenModuleSet
. The path separator is normalized to '/'.
-
getVersion
public String 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
public String getPackaging()
Packaging type of the module. pom, jar, maven-plugin, ejb, war, ear, rar, par or other custom types.- Since:
- 2.1
-
getGroupId
public String getGroupId()
Short-cut forgetModuleName().groupId
- Since:
- 2.1
-
getArtifactId
public String getArtifactId()
Short-cut forgetModuleName().artifactId
- Since:
- 2.1
-
getGoals
public String getGoals()
Gets the list of goals to execute for this module.
-
getUserConfiguredGoals
public String 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
public DescribableList<Publisher,Descriptor<Publisher>> getPublishersList()
- Specified by:
getPublishersList
in classAbstractProject<MavenModule,MavenBuild>
-
getJDK
public JDK getJDK()
- Overrides:
getJDK
in classAbstractProject<MavenModule,MavenBuild>
-
getBuildClass
protected Class<MavenBuild> getBuildClass()
- Specified by:
getBuildClass
in classAbstractProject<MavenModule,MavenBuild>
-
newBuild
protected MavenBuild newBuild() throws IOException
- Overrides:
newBuild
in classAbstractProject<MavenModule,MavenBuild>
- Throws:
IOException
-
getModuleName
public ModuleName getModuleName()
-
asDependency
public ModuleDependency asDependency()
Gets groupId+artifactId+version asModuleDependency
.
-
getShortUrl
public String getShortUrl()
- Specified by:
getShortUrl
in interfaceItem
- Overrides:
getShortUrl
in classAbstractItem
-
getDisplayName
@Exported(visibility=2) public String getDisplayName()
- Specified by:
getDisplayName
in interfaceItem
- Specified by:
getDisplayName
in interfaceModelObject
- Specified by:
getDisplayName
in interfaceResourceActivity
- Overrides:
getDisplayName
in classAbstractItem
-
getPronoun
public String getPronoun()
- Overrides:
getPronoun
in classAbstractProject<MavenModule,MavenBuild>
-
isNameEditable
public boolean isNameEditable()
- Overrides:
isNameEditable
in classJob<MavenModule,MavenBuild>
-
getParent
public MavenModuleSet getParent()
- Specified by:
getParent
in interfaceItem
- Overrides:
getParent
in classAbstractItem
-
getChildren
public List<MavenModule> 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
public Label 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
public Resource 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
protected void buildDependencyGraph(DependencyGraph graph)
- Overrides:
buildDependencyGraph
in classAbstractProject<MavenModule,MavenBuild>
-
getAllMavenModules
protected Collection<MavenModule> 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
public Maven.MavenInstallation inferMavenInstallation()
- Specified by:
inferMavenInstallation
in interfaceMaven.ProjectWithMaven
-
getReporters
public DescribableList<MavenReporter,Descriptor<MavenReporter>> 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
protected void performDelete() throws IOException, InterruptedException
- Overrides:
performDelete
in classAbstractProject<MavenModule,MavenBuild>
- Throws:
IOException
InterruptedException
-
createReporters
protected List<MavenReporter> createReporters()
Creates a list ofMavenReporter
s to be used for a build of this project.
-
getDependencies
public Set<ModuleDependency> getDependencies()
defensive copy ofModuleDependency
- Since:
- 2.2
-
toString
public String toString()
for debug purpose- Overrides:
toString
in classAbstractItem
-
-