hudson.maven
Class MavenModule

java.lang.Object
  extended by hudson.model.AbstractModelObject
      extended by hudson.model.Actionable
          extended by hudson.model.AbstractItem
              extended by hudson.model.Job<P,R>
                  extended by hudson.model.AbstractProject<P,R>
                      extended by hudson.maven.AbstractMavenProject<MavenModule,MavenBuild>
                          extended by hudson.maven.MavenModule
All Implemented Interfaces:
ExtensionPoint, BuildableItem, DescriptorByNameOwner, Item, ModelObject, PersistenceRoot, SubTask, Queue.Task, ResourceActivity, Saveable, SearchableModelObject, SearchItem, AccessControlled, Maven.ProjectWithMaven, org.kohsuke.stapler.HttpDeletable, org.kohsuke.stapler.StaplerOverridable

public final 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
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Field Summary
 
Fields inherited from class hudson.model.AbstractProject
ABORT, blockBuildWhenDownstreamBuilding, blockBuildWhenUpstreamBuilding, builds, disabled, transientActions, triggers
 
Fields inherited from class hudson.model.Job
HISTORY_ADAPTER, nextBuildNumber, properties
 
Fields inherited from class hudson.model.AbstractItem
description, name
 
Fields inherited from interface hudson.model.Saveable
NOOP
 
Fields inherited from interface hudson.model.Item
BUILD, CONFIGURE, CREATE, DELETE, EXTENDED_READ, PERMISSIONS, READ, WORKSPACE
 
Method Summary
protected  void addTransientActionsFromBuild(MavenBuild build, List<Action> collection, Set<Class> added)
           
 ModuleDependency asDependency()
          Gets groupId+artifactId+version as ModuleDependency.
protected  void buildDependencyGraph(DependencyGraph graph)
           
protected  List<MavenReporter> createReporters()
          Creates a list of MavenReporters to be used for a build of this project.
protected  void doSetName(String name)
           
 Label getAssignedLabel()
          MavenModule uses the workspace of the MavenModuleSet, so it always needs to be built on the same slave 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.)
 String getDisplayName()
           
 String getGoals()
          Gets the list of goals to execute for this module.
 JDK getJDK()
           
 LogRotator getLogRotator()
          MavenModule follows the same log rotation schedule as its parent.
 ModuleName getModuleName()
           
 MavenModuleSet getParent()
           
 String getPronoun()
           
 DescribableList<Publisher,Descriptor<Publisher>> getPublishersList()
           
 String getRelativePath()
          Relative path to this module's root directory from the workspace of a MavenModuleSet.
 DescribableList<MavenReporter,Descriptor<MavenReporter>> getReporters()
          List of active MavenReporters configured for this module.
 String getShortUrl()
           
 List<MavenModule> getSubsidiaries()
          Computes the list of MavenModules 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 in AbstractProject.
 Maven.MavenInstallation inferMavenInstallation()
           
 boolean isBuildable()
           
 boolean isFingerprintConfigured()
           
 boolean isNameEditable()
           
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 purpose
protected  void updateTransientActions()
           
 
Methods inherited from class hudson.maven.AbstractMavenProject
createTransientActions
 
Methods inherited from class hudson.model.AbstractProject
_getRuns, addProperty, addToList, addTrigger, blockBuildWhenDownstreamBuilding, blockBuildWhenUpstreamBuilding, buildDescribable, buildDescribable, checkAbortPermission, checkout, createExecutable, createHistoryWidget, disable, doBuild, doBuildWithParameters, doCancelQueue, doCheckRetryCount, doConfigSubmit, doDisable, doDoWipeOutWorkspace, doEnable, doPolling, doRssChangelog, doWs, enable, findNearest, getActions, getAssignedLabelString, getAuthToken, getBuildingDownstream, getBuildingUpstream, getBuildTriggerUpstreamProjects, getCauseOfBlockage, getDelay, getDownstreamProjects, getHasCustomQuietPeriod, getIconColor, getLastBuiltOn, getModuleRoot, getModuleRoots, getOwnerTask, getProminentActions, getQueueItem, getQuietPeriod, getRelationship, getResourceActivities, getResourceList, getRootProject, getSameNodeConstraint, getScm, getScmCheckoutRetryCount, getSomeBuildWithWorkspace, getSomeWorkspace, getSubTasks, getTransitiveDownstreamProjects, getTransitiveUpstreamProjects, getTrigger, getTriggers, getUpstreamProjects, getWhyBlocked, getWorkspace, hasAbortPermission, hasCustomScmCheckoutRetryCount, hasParticipant, isBuildBlocked, isConcurrentBuild, isConfigurable, isDisabled, isInQueue, isParameterized, loadBuild, makeDisabled, makeSearchIndex, onCreatedFromScratch, poll, pollSCMChanges, removeFromList, removeRun, removeTrigger, resolveForCLI, scheduleBuild, scheduleBuild, scheduleBuild, scheduleBuild, scheduleBuild, scheduleBuild2, scheduleBuild2, scheduleBuild2, scheduleBuild2, schedulePolling, setAssignedLabel, setAssignedNode, setBlockBuildWhenDownstreamBuilding, setBlockBuildWhenUpstreamBuilding, setConcurrentBuild, setJDK, setQuietPeriod, setScm
 
Methods inherited from class hudson.model.Job
assignBuildNumber, doBuildStatus, doDescription, doDoRename, doRssAll, doRssFailed, getACL, getAllJobs, getAllProperties, getBuild, getBuildByNumber, getBuildDir, getBuildForCLI, getBuildHealth, getBuildHealthReports, getBuilds, getBuilds, getBuildsAsMap, getBuildsByTimestamp, getBuildStatusUrl, getBuildTimeGraph, getDynamic, getEstimatedDuration, getFirstBuild, getLastBuild, getLastBuildsOverThreshold, getLastCompletedBuild, getLastFailedBuild, getLastStableBuild, getLastSuccessfulBuild, getLastUnstableBuild, getLastUnsuccessfulBuild, getNearestBuild, getNearestOldBuild, getNextBuildNumber, getOverrides, getPermalinks, getProperties, getProperty, getTimeline, getWidgets, isBuilding, isHoldOffBuildUntilSave, isKeepDependencies, logRotate, onCopiedFrom, removeProperty, removeProperty, renameTo, save, saveNextBuildNumber, updateNextBuildNumber
 
Methods inherited from class hudson.model.AbstractItem
checkPermission, delete, delete, doConfigDotXml, doDoDelete, doSubmitDescription, getAbsoluteUrl, getApi, getConfigFile, getDescription, getDescriptorByName, getFullDisplayName, getFullName, getName, getRootDir, getSearchUrl, getUrl, hasPermission, setDescription
 
Methods inherited from class hudson.model.Actionable
addAction, getAction, getAction, getActions
 
Methods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, getSearchName, 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.model.Saveable
save
 
Methods inherited from interface hudson.model.Item
delete, getAbsoluteUrl, getAllJobs, getFullDisplayName, getFullName, getName, getUrl, onCopiedFrom, save
 
Methods inherited from interface hudson.model.PersistenceRoot
getRootDir
 
Methods inherited from interface hudson.search.SearchableModelObject
getSearch
 
Methods inherited from interface hudson.search.SearchItem
getSearchIndex, getSearchName, getSearchUrl
 
Methods inherited from interface hudson.security.AccessControlled
checkPermission, getACL, hasPermission
 
Methods inherited from interface hudson.model.Queue.Task
getFullDisplayName, getName, getUrl
 
Methods inherited from interface hudson.model.queue.SubTask
getEstimatedDuration
 

Method Detail

getLogRotator

public LogRotator getLogRotator()
MavenModule follows the same log rotation schedule as its parent.

Overrides:
getLogRotator in class Job<MavenModule,MavenBuild>

setLogRotator

public void setLogRotator(LogRotator logRotator)
Deprecated. Not allowed to configure log rotation per module.

Overrides:
setLogRotator in class Job<MavenModule,MavenBuild>

supportsLogRotator

public boolean supportsLogRotator()
Overrides:
supportsLogRotator in class Job<MavenModule,MavenBuild>

isBuildable

public boolean isBuildable()
Overrides:
isBuildable in class AbstractProject<MavenModule,MavenBuild>

getSubsidiaries

public List<MavenModule> getSubsidiaries()
Computes the list of MavenModules 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.


doSetName

protected void doSetName(String name)
Overrides:
doSetName in class AbstractItem

onLoad

public void onLoad(ItemGroup<? extends Item> parent,
                   String name)
            throws IOException
Specified by:
onLoad in interface Item
Overrides:
onLoad in class AbstractProject<MavenModule,MavenBuild>
Throws:
IOException

getRelativePath

public String getRelativePath()
Relative path to this module's root directory from the workspace of a MavenModuleSet. 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 Hudson loaded old data that didn't record this information, so that situation needs to be handled gracefully.

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 class AbstractProject<MavenModule,MavenBuild>

getJDK

public JDK getJDK()
Overrides:
getJDK in class AbstractProject<MavenModule,MavenBuild>

getBuildClass

protected Class<MavenBuild> getBuildClass()
Specified by:
getBuildClass in class AbstractProject<MavenModule,MavenBuild>

newBuild

protected MavenBuild newBuild()
                       throws IOException
Overrides:
newBuild in class AbstractProject<MavenModule,MavenBuild>
Throws:
IOException

getModuleName

public ModuleName getModuleName()

asDependency

public ModuleDependency asDependency()
Gets groupId+artifactId+version as ModuleDependency.


getShortUrl

public String getShortUrl()
Specified by:
getShortUrl in interface Item
Overrides:
getShortUrl in class AbstractItem

getDisplayName

@Exported(visibility=2)
public String getDisplayName()
Specified by:
getDisplayName in interface Item
Specified by:
getDisplayName in interface ModelObject
Specified by:
getDisplayName in interface ResourceActivity
Overrides:
getDisplayName in class AbstractItem

getPronoun

public String getPronoun()
Overrides:
getPronoun in class AbstractProject<MavenModule,MavenBuild>

isNameEditable

public boolean isNameEditable()
Overrides:
isNameEditable in class Job<MavenModule,MavenBuild>

getParent

public MavenModuleSet getParent()
Specified by:
getParent in interface Item
Overrides:
getParent in class AbstractItem

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.


getAssignedLabel

public Label getAssignedLabel()
MavenModule uses the workspace of the MavenModuleSet, so it always needs to be built on the same slave as the parent.

Specified by:
getAssignedLabel in interface SubTask
Overrides:
getAssignedLabel in class AbstractProject<MavenModule,MavenBuild>

getWorkspaceResource

public Resource getWorkspaceResource()
Deprecated. as of 1.319 in AbstractProject.

Workspace of a MavenModule is a part of the parent's workspace.

That is, builds are incompatible with any MavenModule builds, whereas MavenModule builds are compatible with each other.

Overrides:
getWorkspaceResource in class AbstractProject<MavenModule,MavenBuild>

isFingerprintConfigured

public boolean isFingerprintConfigured()
Specified by:
isFingerprintConfigured in class AbstractProject<MavenModule,MavenBuild>

updateTransientActions

protected void updateTransientActions()
Overrides:
updateTransientActions in class AbstractProject<MavenModule,MavenBuild>

buildDependencyGraph

protected void buildDependencyGraph(DependencyGraph graph)
Specified by:
buildDependencyGraph in class AbstractProject<MavenModule,MavenBuild>

addTransientActionsFromBuild

protected void addTransientActionsFromBuild(MavenBuild build,
                                            List<Action> collection,
                                            Set<Class> added)
Specified by:
addTransientActionsFromBuild in class AbstractMavenProject<MavenModule,MavenBuild>
collection - Add the transient actions to this collection.

inferMavenInstallation

public Maven.MavenInstallation inferMavenInstallation()
Specified by:
inferMavenInstallation in interface Maven.ProjectWithMaven

getReporters

public DescribableList<MavenReporter,Descriptor<MavenReporter>> getReporters()
List of active MavenReporters 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 class AbstractProject<MavenModule,MavenBuild>
Throws:
IOException
javax.servlet.ServletException
Descriptor.FormException

performDelete

protected void performDelete()
                      throws IOException,
                             InterruptedException
Overrides:
performDelete in class AbstractProject<MavenModule,MavenBuild>
Throws:
IOException
InterruptedException

createReporters

protected List<MavenReporter> createReporters()
Creates a list of MavenReporters to be used for a build of this project.


toString

public String toString()
for debug purpose

Overrides:
toString in class AbstractItem


Copyright © 2004-2011. All Rights Reserved.