Package hudson.maven
Class MavenModuleSetBuild
- java.lang.Object
-
- hudson.model.AbstractModelObject
-
- hudson.model.Actionable
-
- hudson.model.Run<P,R>
-
- hudson.model.AbstractBuild<P,B>
-
- hudson.maven.AbstractMavenBuild<MavenModuleSet,MavenModuleSetBuild>
-
- hudson.maven.MavenModuleSetBuild
-
- All Implemented Interfaces:
ExtensionPoint
,DescriptorByNameOwner
,ModelObject
,PersistenceRoot
,Queue.Executable
,Saveable
,SearchableModelObject
,SearchItem
,AccessControlled
,Comparable<MavenModuleSetBuild>
,Runnable
,LazyBuildMixIn.LazyLoadingRun<MavenModuleSet,MavenModuleSetBuild>
,ModelObjectWithContextMenu
,RunWithSCM<MavenModuleSet,MavenModuleSetBuild>
,OnMaster
,org.kohsuke.stapler.StaplerProxy
public class MavenModuleSetBuild extends AbstractMavenBuild<MavenModuleSet,MavenModuleSetBuild>
Build
forMavenModuleSet
.A "build" of
MavenModuleSet
consists of:- Update the workspace.
- Parse POMs
- Trigger module builds.
MavenBuild
s are done on this.- Author:
- Kohsuke Kawaguchi
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MavenModuleSetBuild.SimpleTransferListener
will log in theTaskListener
when transferFailed and transferSucceeded-
Nested classes/interfaces inherited from class hudson.model.AbstractBuild
AbstractBuild.AbstractBuildExecution, AbstractBuild.AbstractRunner, AbstractBuild.DependencyChange
-
Nested classes/interfaces inherited from class hudson.model.Run
Run.Artifact, Run.ArtifactList, Run.KeepLogBuildBadge, Run.RedirectUp, Run.RunExecution, Run.Runner, Run.RunnerAbortedException, Run.StatusSummarizer, Run.Summary
-
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 Modifier and Type Field Description 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, LIST_CUTOFF, nextBuild, number, ORDER_BY_DATE, PERMISSIONS, previousBuild, project, QUEUE_ID_UNKNOWN, result, SKIP_PERMISSION_CHECK, timestamp, TREE_CUTOFF, UPDATE, XSTREAM, XSTREAM2
-
-
Constructor Summary
Constructors Constructor Description MavenModuleSetBuild(MavenModuleSet job)
MavenModuleSetBuild(MavenModuleSet project, File buildDir)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
delete()
void
deleteArtifacts()
<T extends Action>
List<T>findModuleBuildActions(Class<T> action)
FindsAction
s from all the module builds that belong to thisMavenModuleSetBuild
.Fingerprint.RangeSet
getDownstreamRelationship(AbstractProject that)
Object
getDynamic(String token, org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
EnvVars
getEnvironment(TaskListener log)
ExposesMAVEN_OPTS
to forked processes.long
getEstimatedDuration()
Returns the estimated duration for this builds.MavenAggregatedArtifactRecord
getMavenArtifacts()
Information about artifacts produced by Maven.String
getMavenOpts(TaskListener listener, EnvVars envVars)
Obtains the fully resolved MAVEN_OPTS with all the tokens and variables expanded.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.protected Boolean
isRelease()
Check if the current build is a release or not.protected void
onLoad()
void
registerAsProjectAction(MavenReporter reporter)
void
run()
void
setMavenVersionUsed(String mavenVersionUsed)
-
Methods inherited from class hudson.maven.AbstractMavenBuild
expandTokens
-
Methods inherited from class hudson.model.AbstractBuild
addAction, calculateCulprits, createReference, doStop, doStop, dropLinks, due, getAggregatedTestResultAction, getBuildVariableResolver, getBuildVariables, getBuiltOn, getBuiltOnStr, getChangeSet, getChangeSets, getCulpritIds, getCulprits, getDependencyChanges, getDownstreamBuilds, getDownstreamBuilds, getEnvironments, getHudsonVersion, getModuleRoot, getModuleRoots, getNextBuild, getParentExecutable, getPersistentActions, getPreviousBuild, getProject, getRootBuild, getRunMixIn, getSensitiveBuildVariables, getTestResultAction, getTransitiveUpstreamBuilds, getUpstreamBuilds, getUpstreamRelationship, getUpstreamRelationshipBuild, getUpUrl, getWhyKeepLog, getWorkspace, hasChangeSetComputed, setBuiltOnStr, setWorkspace, shouldCalculateCulprits
-
Methods inherited from class hudson.model.Run
_this, canToggleLogKeep, compareTo, doArtifact, doBuildNumber, doBuildStatus, doBuildTimestamp, doConfigSubmit, doConsoleText, doDoDelete, doProgressiveLog, doSubmitDescription, doToggleLogKeep, execute, fromExternalizableId, getAbsoluteUrl, getACL, getApi, getArtifactManager, getArtifacts, getArtifactsDir, getArtifactsUpTo, getBadgeActions, getBuildFingerprints, getBuildsOverThreshold, getBuildStatusIconClassName, getBuildStatusSummary, getBuildStatusUrl, getCause, getCauses, getCharacteristicEnvVars, getCharset, getDescription, getDisplayName, getDuration, getDurationString, getEnvironment, getEnvVars, getExecutor, getExternalizableId, getFullDisplayName, getHasArtifacts, getIconColor, getId, getLog, getLog, getLogFile, getLogInputStream, getLogReader, getLogText, getNumber, getOneOffExecutor, getPreviousBuildInProgress, getPreviousBuildsOverThreshold, getPreviousBuiltBuild, getPreviousCompletedBuild, getPreviousFailedBuild, getPreviousNotFailedBuild, getPreviousSuccessfulBuild, getQueueId, getRootDir, getSearchUrl, getStartTimeInMillis, getTarget, getTime, getTimeInMillis, getTimestamp, getTimestampString, getTimestampString2, getTransientActions, getTruncatedDescription, getUrl, hasCustomDisplayName, hasntStartedYet, isBuilding, isInProgress, isKeepLog, isLogUpdated, keepLog, keepLog, makeSearchIndex, onEndBuilding, onStartBuilding, pickArtifactManager, reload, run, save, setDescription, setDisplayName, setQueueId, setResult, submit, toString, updateSymlinks, writeLogTo, writeReplace, writeWholeLogTo
-
Methods inherited from class hudson.model.Actionable
addOrReplaceAction, doContextMenu, getAction, getAction, getActions, getActions, getAllActions, removeAction, removeActions, replaceAction, replaceActions
-
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.security.AccessControlled
checkAnyPermission, checkPermission, hasAnyPermission, hasPermission, hasPermission, hasPermission2
-
Methods inherited from interface hudson.model.DescriptorByNameOwner
getDescriptorByName
-
Methods inherited from interface hudson.model.Queue.Executable
toString
-
Methods inherited from interface jenkins.scm.RunWithSCM
hasParticipant
-
-
-
-
Constructor Detail
-
MavenModuleSetBuild
public MavenModuleSetBuild(MavenModuleSet job) throws IOException
- Throws:
IOException
-
MavenModuleSetBuild
public MavenModuleSetBuild(MavenModuleSet project, File buildDir) throws IOException
- Throws:
IOException
-
-
Method Detail
-
onLoad
protected void onLoad()
- Overrides:
onLoad
in classRun<MavenModuleSet,MavenModuleSetBuild>
-
getEnvironment
public EnvVars getEnvironment(TaskListener log) throws IOException, InterruptedException
ExposesMAVEN_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 inMavenProcessFactory
), 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 classAbstractMavenBuild<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 classRun<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 interfaceQueue.Executable
- Overrides:
getEstimatedDuration
in classRun<MavenModuleSet,MavenModuleSetBuild>
- Returns:
- the estimated duration in milliseconds
- Since:
- 1.383
-
getMavenVersionUsed
@Exported public String getMavenVersionUsed()
Gets the version of Maven used for build.- Returns:
- null if this build is done by earlier version of Jenkins 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 classRun<MavenModuleSet,MavenModuleSetBuild>
- Throws:
IOException
-
deleteArtifacts
public void deleteArtifacts() throws IOException
- Overrides:
deleteArtifacts
in classRun<MavenModuleSet,MavenModuleSetBuild>
- Throws:
IOException
-
getDynamic
public Object getDynamic(String token, org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
- Overrides:
getDynamic
in classRun<MavenModuleSet,MavenModuleSetBuild>
-
getMavenArtifacts
@Exported public MavenAggregatedArtifactRecord getMavenArtifacts()
Information about artifacts produced by Maven.
-
getModuleLastBuilds
public Map<MavenModule,MavenBuild> getModuleLastBuilds()
Computes the latest module builds that correspond to this build. (when individual 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)
FindsAction
s from all the module builds that belong to thisMavenModuleSetBuild
. One action per oneMavenModule
, and newer ones take precedence over older ones.
-
run
public void run()
- Specified by:
run
in interfaceQueue.Executable
- Specified by:
run
in interfaceRunnable
- Specified by:
run
in classAbstractBuild<MavenModuleSet,MavenModuleSetBuild>
-
getDownstreamRelationship
public Fingerprint.RangeSet getDownstreamRelationship(AbstractProject that)
- Overrides:
getDownstreamRelationship
in classAbstractBuild<MavenModuleSet,MavenModuleSetBuild>
-
getMavenOpts
public String getMavenOpts(TaskListener listener, EnvVars envVars)
Description copied from class:AbstractMavenBuild
Obtains the fully resolved MAVEN_OPTS with all the tokens and variables expanded.- Specified by:
getMavenOpts
in classAbstractMavenBuild<MavenModuleSet,MavenModuleSetBuild>
envVars
- Caller must pass in the environment variables obtained fromAbstractMavenBuild.getEnvironment(TaskListener)
This method takes this as a parameter as opposed to recomputing it since the caller always have this handy.- See Also:
MavenModuleSet.getMavenOpts()
-
isRelease
protected Boolean isRelease()
Check if the current build is a release or not. If all its maven modules are not SNAPSHOT then it is a release- Returns:
- true if
MavenModuleSetBuild
is a release - Since:
- 2.12.2
-
getParent
public MavenModuleSet getParent()
- Specified by:
getParent
in interfaceQueue.Executable
- Overrides:
getParent
in classAbstractBuild<MavenModuleSet,MavenModuleSetBuild>
-
-