hudson.maven
Class MavenModuleSetBuild

java.lang.Object
  extended by hudson.model.AbstractModelObject
      extended by hudson.model.Actionable
          extended by hudson.model.Run<P,R>
              extended by hudson.model.AbstractBuild<P,B>
                  extended by hudson.maven.AbstractMavenBuild<MavenModuleSet,MavenModuleSetBuild>
                      extended by hudson.maven.MavenModuleSetBuild
All Implemented Interfaces:
ExtensionPoint, DescriptorByNameOwner, ModelObject, PersistenceRoot, Queue.Executable, Saveable, SearchableModelObject, SearchItem, AccessControlled, Comparable<MavenModuleSetBuild>, Runnable

public class MavenModuleSetBuild
extends AbstractMavenBuild<MavenModuleSet,MavenModuleSetBuild>

Build for MavenModuleSet.

A "build" of MavenModuleSet consists of:

  1. Update the workspace.
  2. Parse POMs
  3. Trigger module builds.
This object remembers the changelog and what MavenBuilds are done on this.

Author:
Kohsuke Kawaguchi

Nested Class Summary
static class MavenModuleSetBuild.SimpleTransferListener
          will log in the TaskListener when transferFailed and transferSucceeded
 
Nested classes/interfaces inherited from class hudson.model.AbstractBuild
AbstractBuild.AbstractRunner, AbstractBuild.DependencyChange
 
Nested classes/interfaces inherited from class hudson.model.Run
Run.Artifact, Run.ArtifactList, Run.KeepLogBuildBadge, Run.RedirectUp, Run.Runner, Run.RunnerAbortedException, Run.Summary
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Field Summary
static boolean debug
          Extra verbose debug switch.
 
Fields inherited from class hudson.model.AbstractBuild
buildEnvironments
 
Fields inherited from class hudson.model.Run
ARTIFACTS, charset, DELETE, description, duration, FEED_ADAPTER, FEED_ADAPTER_LATEST, ID_FORMATTER, LIST_CUTOFF, nextBuild, number, ORDER_BY_DATE, PERMISSIONS, previousBuild, project, result, state, timestamp, TREE_CUTOFF, UPDATE, XSTREAM
 
Fields inherited from interface hudson.model.Saveable
NOOP
 
Constructor Summary
MavenModuleSetBuild(MavenModuleSet job)
           
MavenModuleSetBuild(MavenModuleSet project, File buildDir)
           
 
Method Summary
 void delete()
           
<T extends Action>
List<T>
findModuleBuildActions(Class<T> action)
          Finds Actions from all the module builds that belong to this MavenModuleSetBuild.
 Fingerprint.RangeSet getDownstreamRelationship(AbstractProject that)
           
 Object getDynamic(String token, org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
           
 EnvVars getEnvironment(TaskListener log)
          Exposes MAVEN_OPTS to forked processes.
 long getEstimatedDuration()
          Returns the estimated duration for this builds.
 String getMavenVersionUsed()
          Gets the version of Maven used for build.
 Map<MavenModule,List<MavenBuild>> getModuleBuilds()
          Computes the module builds that correspond to this build.
 Map<MavenModule,MavenBuild> getModuleLastBuilds()
          Computes the latest module builds that correspond to this build.
 MavenModuleSet getParent()
           
 Result getResult()
          Displays the combined status of all modules.
 void registerAsProjectAction(MavenReporter reporter)
           
 void run()
           
 void setMavenVersionUsed(String mavenVersionUsed)
           
 
Methods inherited from class hudson.model.AbstractBuild
doStop, due, getBuildVariableResolver, getBuildVariables, getBuiltOn, getBuiltOnStr, getChangeSet, getCulprits, getDependencyChanges, getDownstreamBuilds, getDownstreamBuilds, getHudsonVersion, getModuleRoot, getModuleRoots, getProject, getSensitiveBuildVariables, getTestResultAction, getTransitiveUpstreamBuilds, getUpstreamBuilds, getUpstreamRelationship, getUpstreamRelationshipBuild, getUpUrl, getWhyKeepLog, getWorkspace, hasChangeSetComputed, hasParticipant, setWorkspace
 
Methods inherited from class hudson.model.Run
addAction, checkPermission, compareTo, deleteArtifacts, doArtifact, doBuildNumber, doBuildStatus, doBuildTimestamp, doConfigSubmit, doConsoleText, doDoDelete, doProgressiveLog, doSubmitDescription, doToggleLogKeep, fromExternalizableId, getAbsoluteUrl, getACL, getApi, getArtifacts, getArtifactsDir, getArtifactsUpTo, getBadgeActions, getBuildStatusSummary, getBuildStatusUrl, getCause, getCauses, getCharacteristicEnvVars, getCharset, getDescription, getDescriptorByName, getDisplayName, getDuration, getDurationString, getEnvironment, getEnvVars, getExecutor, getExternalizableId, getFullDisplayName, getHasArtifacts, getIconColor, getId, getIDFormatter, getLog, getLog, getLogFile, getLogInputStream, getLogReader, getLogText, getNextBuild, getNumber, getPreviousBuild, getPreviousBuildInProgress, getPreviousBuildsOverThreshold, getPreviousBuiltBuild, getPreviousCompletedBuild, getPreviousFailedBuild, getPreviousNotFailedBuild, getPreviousSuccessfulBuild, getRootDir, getSearchUrl, getTime, getTimeInMillis, getTimestamp, getTimestampString, getTimestampString2, getTruncatedDescription, getUrl, hasCustomDisplayName, hasntStartedYet, hasPermission, isBuilding, isKeepLog, isLogUpdated, keepLog, keepLog, makeSearchIndex, onEndBuilding, onLoad, onStartBuilding, run, save, setDescription, setDisplayName, setResult, submit, toString, writeLogTo
 
Methods inherited from class hudson.model.Actionable
getAction, getAction, getActions, 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, toString, wait, wait, wait
 
Methods inherited from interface hudson.model.Queue.Executable
toString
 

Field Detail

debug

public static boolean debug
Extra verbose debug switch.

Constructor Detail

MavenModuleSetBuild

public MavenModuleSetBuild(MavenModuleSet job)
                    throws IOException
Throws:
IOException

MavenModuleSetBuild

public MavenModuleSetBuild(MavenModuleSet project,
                           File buildDir)
                    throws IOException
Throws:
IOException
Method Detail

getEnvironment

public EnvVars getEnvironment(TaskListener log)
                       throws IOException,
                              InterruptedException
Exposes MAVEN_OPTS to forked processes. When we fork Maven, we do so directly by executing Java, thus this environment variable is pointless (we have to tweak JVM launch option correctly instead, which can be seen in MavenProcessFactory), but setting the environment variable explicitly is still useful in case this Maven forks other Maven processes via normal way. See HUDSON-3644.

Overrides:
getEnvironment in class AbstractBuild<MavenModuleSet,MavenModuleSetBuild>
Throws:
IOException
InterruptedException

getResult

public Result getResult()
Displays the combined status of all modules.

More precisely, this picks up the status of this build itself, plus all the latest builds of the modules that belongs to this build.

Overrides:
getResult in class Run<MavenModuleSet,MavenModuleSetBuild>

getModuleBuilds

public Map<MavenModule,List<MavenBuild>> getModuleBuilds()
Computes the module builds that correspond to this build.

A module may be built multiple times (by the user action), so the value is a list.


getEstimatedDuration

public long getEstimatedDuration()
Returns the estimated duration for this builds. Takes only the modules into account which are actually being build in case of incremental builds.

Specified by:
getEstimatedDuration in interface Queue.Executable
Overrides:
getEstimatedDuration in class Run<MavenModuleSet,MavenModuleSetBuild>

getMavenVersionUsed

public String getMavenVersionUsed()
Gets the version of Maven used for build.

Returns:
null if this build is done by earlier version of Hudson that didn't record this information (this means the build was done by Maven2.x)

setMavenVersionUsed

public void setMavenVersionUsed(String mavenVersionUsed)
                         throws IOException
Throws:
IOException

delete

public void delete()
            throws IOException
Overrides:
delete in class AbstractBuild<MavenModuleSet,MavenModuleSetBuild>
Throws:
IOException

getDynamic

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

getModuleLastBuilds

public Map<MavenModule,MavenBuild> getModuleLastBuilds()
Computes the latest module builds that correspond to this build. (when indivudual modules are built, a new ModuleSetBuild is not created, but rather the new module build falls under the previous ModuleSetBuild)


registerAsProjectAction

public void registerAsProjectAction(MavenReporter reporter)

findModuleBuildActions

public <T extends Action> List<T> findModuleBuildActions(Class<T> action)
Finds Actions from all the module builds that belong to this MavenModuleSetBuild. One action per one MavenModule, and newer ones take precedence over older ones.


run

public void run()
Specified by:
run in interface Queue.Executable
Specified by:
run in interface Runnable
Specified by:
run in class AbstractBuild<MavenModuleSet,MavenModuleSetBuild>

getDownstreamRelationship

public Fingerprint.RangeSet getDownstreamRelationship(AbstractProject that)
Overrides:
getDownstreamRelationship in class AbstractBuild<MavenModuleSet,MavenModuleSetBuild>

getParent

public MavenModuleSet getParent()
Specified by:
getParent in interface Queue.Executable
Overrides:
getParent in class AbstractBuild<MavenModuleSet,MavenModuleSetBuild>


Copyright © 2004-2011. All Rights Reserved.