hudson.maven
Class MavenModuleSet

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<MavenModuleSet,MavenModuleSetBuild>
                          extended by hudson.maven.MavenModuleSet
All Implemented Interfaces:
ExtensionPoint, BuildableItem, BuildableItemWithBuildWrappers, Describable<TopLevelItem>, DescriptorByNameOwner, Item, ItemGroup<MavenModule>, ModelObject, PersistenceRoot, SubTask, Queue.Task, ResourceActivity, Saveable, SCMedItem, TopLevelItem, SearchableModelObject, SearchItem, AccessControlled, Maven.ProjectWithMaven, org.kohsuke.stapler.HttpDeletable, org.kohsuke.stapler.StaplerOverridable

public final class MavenModuleSet
extends AbstractMavenProject<MavenModuleSet,MavenModuleSetBuild>
implements TopLevelItem, ItemGroup<MavenModule>, SCMedItem, Saveable, BuildableItemWithBuildWrappers

Group of MavenModules.

This corresponds to the group of Maven POMs that constitute a single tree of projects. This group serves as the grouping of those related modules.

Author:
Kohsuke Kawaguchi

Nested Class Summary
static class MavenModuleSet.DescriptorImpl
           
 
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
static MavenModuleSet.DescriptorImpl DESCRIPTOR
           
 
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.Item
BUILD, CONFIGURE, CREATE, DELETE, EXTENDED_READ, PERMISSIONS, READ, WORKSPACE
 
Constructor Summary
MavenModuleSet(ItemGroup parent, String name)
           
MavenModuleSet(String name)
           
 
Method Summary
protected  void addTransientActionsFromBuild(MavenModuleSetBuild build, List<Action> collection, Set<Class> added)
           
 AbstractProject<?,?> asProject()
           
 int assignBuildNumber()
          To make it easy to grasp relationship among modules and the module set, we'll align the build numbers of all the modules.
protected  void buildDependencyGraph(DependencyGraph graph)
           
 Indenter<MavenModule> createIndenter()
           
protected  List<Action> createTransientActions()
           
 FormValidation doCheckFileInWorkspace(String value)
          Check the location of the POM, alternate settings file, etc - any file.
 FormValidation doCheckFileRelative(String value)
          Check that the provided file is a relative path.
 void doDoDeleteAllDisabledModules(org.kohsuke.stapler.StaplerResponse rsp)
          Delete all disabled modules.
 Collection<Job> getAllJobs()
           
 String getAlternateSettings()
          Gets the workspace-relative path to an alternative Maven settings.xml file.
protected  Class<MavenModuleSetBuild> getBuildClass()
           
 DescribableList<BuildWrapper,Descriptor<BuildWrapper>> getBuildWrappers()
          Deprecated. as of 1.335 Use getBuildWrappersList() to be consistent with other subtypes of AbstractProject.
 DescribableList<BuildWrapper,Descriptor<BuildWrapper>> getBuildWrappersList()
           
 MavenModuleSet.DescriptorImpl getDescriptor()
           
 List<MavenModule> getDisabledModules(boolean disabled)
          Possibly empty list of all disabled modules (if disabled==true) or all enabeld modules (if disabled==false)
 Object getDynamic(String token, org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
           
 String getGoals()
          Gets the list of goals to execute.
 MavenModule getItem(String name)
           
 Collection<MavenModule> getItems()
           
 Maven.MavenInstallation getMaven()
          Gets the Maven to invoke.
 String getMavenOpts()
          Possibly null, whitespace-separated (including TAB, NL, etc) VM options to be used to launch Maven process.
 Properties getMavenProperties()
          Gets the system properties explicitly set in the Maven command line (the "-D" option.)
 int getMavenValidationLevel()
           
 MavenModule getModule(String name)
           
 Collection<MavenModule> getModules()
           
 String getProfiles()
          If the list of configured goals contain the "-P" option, return the configured profiles.
 DescribableList<Publisher,Descriptor<Publisher>> getPublishers()
          List of active Publishers.
 DescribableList<Publisher,Descriptor<Publisher>> getPublishersList()
           
 List<Queue.Item> getQueueItems()
          Returns the MavenModules that are in the queue.
 DescribableList<MavenReporter,Descriptor<MavenReporter>> getReporters()
          List of active MavenReporters that should be applied to all module builds.
protected  Set<ResourceActivity> getResourceActivities()
           
 File getRootDirFor(MavenModule child)
           
 MavenModule getRootModule()
           
 String getRootPOM()
          Gets the location of top-level pom.xml relative to the workspace root.
 String getUrlChildPrefix()
           
 String getUserConfiguredGoals()
          Gets the list of goals specified by the user, without taking inheritance and POM default goals into account.
 boolean hasDisabledModule()
          Returns true if there's any disabled module.
 boolean ignoreUpstremChanges()
           
 Maven.MavenInstallation inferMavenInstallation()
           
 boolean isAggregatorStyleBuild()
           
 boolean isArchivingDisabled()
           
 boolean isFingerprintConfigured()
           
 boolean isIncrementalBuild()
           
 boolean isNonRecursive()
          Check for "-N" or "--non-recursive" in the Maven goals/options.
 boolean isProcessPlugins()
           
 boolean isResolveDependencies()
           
 void logRotate()
           
protected  SearchIndexBuilder makeSearchIndex()
           
 void onDeleted(MavenModule item)
           
 void onLoad(ItemGroup<? extends Item> parent, String name)
           
 void onRenamed(MavenModule item, String oldName, String newName)
           
 void setAggregatorStyleBuild(boolean aggregatorStyleBuild)
           
 void setAlternateSettings(String alternateSettings)
          Sets the workspace-relative path to an alternative Maven settings.xml file.
 void setGoals(String goals)
           
 void setIgnoreUpstremChanges(boolean ignoreUpstremChanges)
           
 void setIncrementalBuild(boolean incrementalBuild)
           
 void setIsArchivingDisabled(boolean archivingDisabled)
           
 void setMaven(String mavenName)
           
 void setMavenOpts(String mavenOpts)
          Set mavenOpts.
 void setProcessPlugins(boolean processPlugins)
           
 void setResolveDependencies(boolean resolveDependencies)
           
 void setRootPOM(String rootPOM)
           
 void setUsePrivateRepository(boolean usePrivateRepository)
           
protected  void submit(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
           
protected  void updateTransientActions()
           
 boolean usesPrivateRepository()
           
 
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, getAssignedLabel, getAssignedLabelString, getAuthToken, getBuildingDownstream, getBuildingUpstream, getBuildTriggerUpstreamProjects, getCauseOfBlockage, getDelay, getDownstreamProjects, getHasCustomQuietPeriod, getIconColor, getJDK, getLastBuiltOn, getModuleRoot, getModuleRoots, getOwnerTask, getProminentActions, getPronoun, getQueueItem, getQuietPeriod, getRelationship, getResourceList, getRootProject, getSameNodeConstraint, getScm, getScmCheckoutRetryCount, getSomeBuildWithWorkspace, getSomeWorkspace, getSubTasks, getTransitiveDownstreamProjects, getTransitiveUpstreamProjects, getTrigger, getTriggers, getUpstreamProjects, getWhyBlocked, getWorkspace, getWorkspaceResource, hasAbortPermission, hasCustomScmCheckoutRetryCount, hasParticipant, isBuildable, isBuildBlocked, isConcurrentBuild, isConfigurable, isDisabled, isInQueue, isParameterized, loadBuild, makeDisabled, newBuild, onCreatedFromScratch, performDelete, 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
doBuildStatus, doDescription, doDoRename, doRssAll, doRssFailed, getACL, getAllProperties, getBuild, getBuildByNumber, getBuildDir, getBuildForCLI, getBuildHealth, getBuildHealthReports, getBuilds, getBuilds, getBuildsAsMap, getBuildsByTimestamp, getBuildStatusUrl, getBuildTimeGraph, getEstimatedDuration, getFirstBuild, getLastBuild, getLastBuildsOverThreshold, getLastCompletedBuild, getLastFailedBuild, getLastStableBuild, getLastSuccessfulBuild, getLastUnstableBuild, getLastUnsuccessfulBuild, getLogRotator, getNearestBuild, getNearestOldBuild, getNextBuildNumber, getOverrides, getPermalinks, getProperties, getProperty, getTimeline, getWidgets, isBuilding, isHoldOffBuildUntilSave, isKeepDependencies, isNameEditable, onCopiedFrom, removeProperty, removeProperty, renameTo, save, saveNextBuildNumber, setLogRotator, supportsLogRotator, updateNextBuildNumber
 
Methods inherited from class hudson.model.AbstractItem
checkPermission, delete, delete, doConfigDotXml, doDoDelete, doSetName, doSubmitDescription, getAbsoluteUrl, getApi, getConfigFile, getDescription, getDescriptorByName, getDisplayName, getFullDisplayName, getFullName, getName, getParent, getRootDir, getSearchUrl, getShortUrl, getUrl, hasPermission, setDescription, toString
 
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.ItemGroup
getFullDisplayName, getFullName, getUrl
 
Methods inherited from interface hudson.model.SCMedItem
getScm, poll, pollSCMChanges
 
Methods inherited from interface hudson.model.BuildableItem
scheduleBuild, scheduleBuild, scheduleBuild, scheduleBuild
 
Methods inherited from interface hudson.model.Item
delete, getAbsoluteUrl, getDisplayName, getFullDisplayName, getFullName, getName, getParent, getShortUrl, getUrl, onCopiedFrom, onCreatedFromScratch
 
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
checkAbortPermission, getCauseOfBlockage, getFullDisplayName, getName, getSubTasks, getUrl, getWhyBlocked, hasAbortPermission, isBuildBlocked, isConcurrentBuild
 
Methods inherited from interface hudson.model.queue.SubTask
createExecutable, getAssignedLabel, getEstimatedDuration, getLastBuiltOn, getOwnerTask, getSameNodeConstraint
 
Methods inherited from interface hudson.model.ResourceActivity
getDisplayName, getResourceList
 

Field Detail

DESCRIPTOR

@Extension(ordinal=900.0)
public static final MavenModuleSet.DescriptorImpl DESCRIPTOR
Constructor Detail

MavenModuleSet

public MavenModuleSet(String name)

MavenModuleSet

public MavenModuleSet(ItemGroup parent,
                      String name)
Method Detail

getUrlChildPrefix

public String getUrlChildPrefix()
Specified by:
getUrlChildPrefix in interface ItemGroup<MavenModule>

getItems

public Collection<MavenModule> getItems()
Specified by:
getItems in interface ItemGroup<MavenModule>

getModules

@Exported
public Collection<MavenModule> getModules()

getItem

public MavenModule getItem(String name)
Specified by:
getItem in interface ItemGroup<MavenModule>

getModule

public MavenModule getModule(String name)

updateTransientActions

protected void updateTransientActions()
Overrides:
updateTransientActions in class AbstractProject<MavenModuleSet,MavenModuleSetBuild>

createTransientActions

protected List<Action> createTransientActions()
Overrides:
createTransientActions in class AbstractMavenProject<MavenModuleSet,MavenModuleSetBuild>

addTransientActionsFromBuild

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

hasDisabledModule

public boolean hasDisabledModule()
Returns true if there's any disabled module.


getDisabledModules

public List<MavenModule> getDisabledModules(boolean disabled)
Possibly empty list of all disabled modules (if disabled==true) or all enabeld modules (if disabled==false)


createIndenter

public Indenter<MavenModule> createIndenter()

isIncrementalBuild

public boolean isIncrementalBuild()

isAggregatorStyleBuild

public boolean isAggregatorStyleBuild()

usesPrivateRepository

public boolean usesPrivateRepository()

ignoreUpstremChanges

public boolean ignoreUpstremChanges()

isArchivingDisabled

public boolean isArchivingDisabled()

setIncrementalBuild

public void setIncrementalBuild(boolean incrementalBuild)

setAggregatorStyleBuild

public void setAggregatorStyleBuild(boolean aggregatorStyleBuild)

setUsePrivateRepository

public void setUsePrivateRepository(boolean usePrivateRepository)

setIgnoreUpstremChanges

public void setIgnoreUpstremChanges(boolean ignoreUpstremChanges)

setIsArchivingDisabled

public void setIsArchivingDisabled(boolean archivingDisabled)

isResolveDependencies

public boolean isResolveDependencies()

setResolveDependencies

public void setResolveDependencies(boolean resolveDependencies)

isProcessPlugins

public boolean isProcessPlugins()

setProcessPlugins

public void setProcessPlugins(boolean processPlugins)

getMavenValidationLevel

public int getMavenValidationLevel()

getReporters

public DescribableList<MavenReporter,Descriptor<MavenReporter>> getReporters()
List of active MavenReporters that should be applied to all module builds.


getPublishers

public DescribableList<Publisher,Descriptor<Publisher>> getPublishers()
List of active Publishers. Can be empty but never null.


getPublishersList

public DescribableList<Publisher,Descriptor<Publisher>> getPublishersList()
Specified by:
getPublishersList in class AbstractProject<MavenModuleSet,MavenModuleSetBuild>

getBuildWrappersList

public DescribableList<BuildWrapper,Descriptor<BuildWrapper>> getBuildWrappersList()
Specified by:
getBuildWrappersList in interface BuildableItemWithBuildWrappers

getBuildWrappers

public DescribableList<BuildWrapper,Descriptor<BuildWrapper>> getBuildWrappers()
Deprecated. as of 1.335 Use getBuildWrappersList() to be consistent with other subtypes of AbstractProject.

List of active BuildWrappers. Can be empty but never null.


getDynamic

public Object getDynamic(String token,
                         org.kohsuke.stapler.StaplerRequest req,
                         org.kohsuke.stapler.StaplerResponse rsp)
Overrides:
getDynamic in class Job<MavenModuleSet,MavenModuleSetBuild>

getRootDirFor

public File getRootDirFor(MavenModule child)
Specified by:
getRootDirFor in interface ItemGroup<MavenModule>

onRenamed

public void onRenamed(MavenModule item,
                      String oldName,
                      String newName)
               throws IOException
Specified by:
onRenamed in interface ItemGroup<MavenModule>
Throws:
IOException

onDeleted

public void onDeleted(MavenModule item)
               throws IOException
Specified by:
onDeleted in interface ItemGroup<MavenModule>
Throws:
IOException

getAllJobs

public Collection<Job> getAllJobs()
Specified by:
getAllJobs in interface Item
Overrides:
getAllJobs in class Job<MavenModuleSet,MavenModuleSetBuild>

getBuildClass

protected Class<MavenModuleSetBuild> getBuildClass()
Specified by:
getBuildClass in class AbstractProject<MavenModuleSet,MavenModuleSetBuild>

makeSearchIndex

protected SearchIndexBuilder makeSearchIndex()
Overrides:
makeSearchIndex in class AbstractProject<MavenModuleSet,MavenModuleSetBuild>

isFingerprintConfigured

public boolean isFingerprintConfigured()
Specified by:
isFingerprintConfigured in class AbstractProject<MavenModuleSet,MavenModuleSetBuild>

onLoad

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

assignBuildNumber

public int assignBuildNumber()
                      throws IOException
To make it easy to grasp relationship among modules and the module set, we'll align the build numbers of all the modules.

This method is invoked from Executor.run(), and because of the mutual exclusion among MavenModuleSetBuild and MavenBuild, we can safely touch all the modules.

Overrides:
assignBuildNumber in class Job<MavenModuleSet,MavenModuleSetBuild>
Throws:
IOException

logRotate

public void logRotate()
               throws IOException,
                      InterruptedException
Overrides:
logRotate in class Job<MavenModuleSet,MavenModuleSetBuild>
Throws:
IOException
InterruptedException

buildDependencyGraph

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

getRootModule

public MavenModule getRootModule()

inferMavenInstallation

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

getResourceActivities

protected Set<ResourceActivity> getResourceActivities()
Overrides:
getResourceActivities in class AbstractProject<MavenModuleSet,MavenModuleSetBuild>

getRootPOM

public String getRootPOM()
Gets the location of top-level pom.xml relative to the workspace root.


setRootPOM

public void setRootPOM(String rootPOM)

asProject

public AbstractProject<?,?> asProject()
Specified by:
asProject in interface BuildableItemWithBuildWrappers
Specified by:
asProject in interface SCMedItem

getGoals

public String getGoals()
Gets the list of goals to execute.


setGoals

public void setGoals(String goals)

getAlternateSettings

public String getAlternateSettings()
Gets the workspace-relative path to an alternative Maven settings.xml file.


setAlternateSettings

public void setAlternateSettings(String alternateSettings)
                          throws IOException
Sets the workspace-relative path to an alternative Maven settings.xml file.

Throws:
IOException

getProfiles

public String getProfiles()
If the list of configured goals contain the "-P" option, return the configured profiles. Otherwise null.


getMavenProperties

public Properties getMavenProperties()
Gets the system properties explicitly set in the Maven command line (the "-D" option.)


isNonRecursive

public boolean isNonRecursive()
Check for "-N" or "--non-recursive" in the Maven goals/options.


getMavenOpts

public String getMavenOpts()
Possibly null, whitespace-separated (including TAB, NL, etc) VM options to be used to launch Maven process. If mavenOpts is null or empty, we'll return the globally-defined MAVEN_OPTS.


setMavenOpts

public void setMavenOpts(String mavenOpts)
Set mavenOpts.


getMaven

public Maven.MavenInstallation getMaven()
Gets the Maven to invoke. If null, we pick any random Maven installation.


setMaven

public void setMaven(String mavenName)

getQueueItems

public List<Queue.Item> getQueueItems()
Returns the MavenModules that are in the queue.


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.


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<MavenModuleSet,MavenModuleSetBuild>
Throws:
IOException
javax.servlet.ServletException
Descriptor.FormException

doDoDeleteAllDisabledModules

public void doDoDeleteAllDisabledModules(org.kohsuke.stapler.StaplerResponse rsp)
                                  throws IOException,
                                         InterruptedException
Delete all disabled modules.

Throws:
IOException
InterruptedException

doCheckFileInWorkspace

public FormValidation doCheckFileInWorkspace(@QueryParameter
                                             String value)
                                      throws IOException,
                                             javax.servlet.ServletException
Check the location of the POM, alternate settings file, etc - any file.

Throws:
IOException
javax.servlet.ServletException

doCheckFileRelative

public FormValidation doCheckFileRelative(@QueryParameter
                                          String value)
                                   throws IOException,
                                          javax.servlet.ServletException
Check that the provided file is a relative path. And check that it exists, just in case.

Throws:
IOException
javax.servlet.ServletException

getDescriptor

public MavenModuleSet.DescriptorImpl getDescriptor()
Specified by:
getDescriptor in interface Describable<TopLevelItem>
Specified by:
getDescriptor in interface TopLevelItem


Copyright © 2004-2011. All Rights Reserved.