Interface MavenBuildProxy
-
- All Known Subinterfaces:
MavenBuildProxy2
- All Known Implementing Classes:
AbstractMavenBuilder.FilterImpl
,MavenBuild.ProxyImpl2
,MavenBuildProxy.Filter
,MavenBuildProxy2.Filter
public interface MavenBuildProxy
Remoting proxy interface forMavenReporter
s to talk toMavenBuild
during the build. That is, this representsMavenBuild
objects in the controller's JVM to code running inside Maven JVM.- Author:
- Kohsuke Kawaguchi
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
MavenBuildProxy.BuildCallable<V,T extends Throwable>
static class
MavenBuildProxy.Filter<CORE extends MavenBuildProxy>
Filter forMavenBuildProxy
.
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description <V,T extends Throwable>
Vexecute(MavenBuildProxy.BuildCallable<V,T> program)
Executes the givenMavenBuildProxy.BuildCallable
on the controller, where one has access toMavenBuild
and all the other Hudson objects.void
executeAsync(MavenBuildProxy.BuildCallable<?,?> program)
Executes the givenMavenBuildProxy.BuildCallable
asynchronously on the controller.FilePath
getArtifactsDir()
Deprecated.Does not work withArtifactManager
.MavenBuildInformation
getMavenBuildInformation()
long
getMilliSecsSinceBuildStart()
# of milliseconds elapsed sincegetTimestamp()
.FilePath
getModuleSetRootDir()
Root directory of the ownerMavenModuleSet
FilePath
getProjectRootDir()
Root directory of the parent of this build.FilePath
getRootDir()
Root directory of the build.Calendar
getTimestamp()
boolean
isArchivingDisabled()
If true, artifacts will not actually be archived to controller.boolean
isSiteArchivingDisabled()
If true, artifacts will not actually be archived to controller during site deploy.void
queueArchiving(String artifactPath, String artifact)
void
registerAsAggregatedProjectAction(MavenReporter reporter)
Nominates that the reporter will contribute a project action for this build by usingMavenReporter.getAggregatedProjectAction(MavenModuleSet)
.void
registerAsProjectAction(MavenProjectActionBuilder builder)
Nominates that the reporter will contribute a project action for this build by usingMavenReporter.getProjectActions(MavenModule)
.void
registerAsProjectAction(MavenReporter reporter)
Nominates that the reporter will contribute a project action for this build by usingMavenReporter.getProjectActions(MavenModule)
.void
setExecutedMojos(List<ExecutedMojo> executedMojos)
Called at the end of the build to record what mojos are executed.void
setResult(Result result)
-
-
-
Method Detail
-
execute
<V,T extends Throwable> V execute(MavenBuildProxy.BuildCallable<V,T> program) throws T extends Throwable, IOException, InterruptedException
Executes the givenMavenBuildProxy.BuildCallable
on the controller, where one has access toMavenBuild
and all the other Hudson objects.The parameter, return value, and exception are all transfered by using Java serialization.
- Returns:
- the value that
MavenBuildProxy.BuildCallable
returned. - Throws:
T
- ifMavenBuildProxy.BuildCallable
throws this exception.IOException
- if the remoting failed.InterruptedException
- if the remote execution is aborted.T extends Throwable
- See Also:
executeAsync(BuildCallable)
-
executeAsync
void executeAsync(MavenBuildProxy.BuildCallable<?,?> program) throws IOException
Executes the givenMavenBuildProxy.BuildCallable
asynchronously on the controller.This method works like
execute(BuildCallable)
except that the method returns immediately and doesn't wait for the completion of the program.The completions of asynchronous executions are accounted for before the build completes. If they throw exceptions, they'll be reported and the build will be marked as a failure.
- Throws:
IOException
-
getRootDir
FilePath getRootDir()
Root directory of the build.
-
getProjectRootDir
FilePath getProjectRootDir()
Root directory of the parent of this build.
-
getModuleSetRootDir
FilePath getModuleSetRootDir()
Root directory of the ownerMavenModuleSet
-
getArtifactsDir
@Deprecated FilePath getArtifactsDir()
Deprecated.Does not work withArtifactManager
.
-
queueArchiving
void queueArchiving(String artifactPath, String artifact)
- Parameters:
artifactPath
- a relative/
-separated pathartifact
- absolute path name on the agent in the workspace- Since:
- 1.532
- See Also:
ArtifactManager.archive(hudson.FilePath, hudson.Launcher, hudson.model.BuildListener, java.util.Map<java.lang.String, java.lang.String>)
-
setResult
void setResult(Result result)
- See Also:
Run.setResult(Result)
-
getTimestamp
Calendar getTimestamp()
- See Also:
Run.getTimestamp()
-
getMilliSecsSinceBuildStart
long getMilliSecsSinceBuildStart()
# of milliseconds elapsed sincegetTimestamp()
. Where the clock skew is involved between the controller and the Maven JVM, comparing current time on Maven JVM withgetTimestamp()
could be problematic, but this value is more robust.
-
isArchivingDisabled
boolean isArchivingDisabled()
If true, artifacts will not actually be archived to controller. CallsMavenModuleSet.isArchivingDisabled()
.
-
isSiteArchivingDisabled
boolean isSiteArchivingDisabled()
If true, artifacts will not actually be archived to controller during site deploy. CallsMavenModuleSet.isSiteArchivingDisabled()
.
-
registerAsProjectAction
void registerAsProjectAction(MavenReporter reporter)
Nominates that the reporter will contribute a project action for this build by usingMavenReporter.getProjectActions(MavenModule)
.The specified
MavenReporter
object will be transfered to the controller and will become a persisted part of theMavenBuild
.
-
registerAsProjectAction
void registerAsProjectAction(MavenProjectActionBuilder builder)
Nominates that the reporter will contribute a project action for this build by usingMavenReporter.getProjectActions(MavenModule)
.The specified
MavenReporter
object will be transferred to the controller and will become a persisted part of theMavenBuild
.- Since:
- 1.372
-
registerAsAggregatedProjectAction
void registerAsAggregatedProjectAction(MavenReporter reporter)
Nominates that the reporter will contribute a project action for this build by usingMavenReporter.getAggregatedProjectAction(MavenModuleSet)
.The specified
MavenReporter
object will be transfered to the controller and will become a persisted part of theMavenModuleSetBuild
.
-
setExecutedMojos
void setExecutedMojos(List<ExecutedMojo> executedMojos)
Called at the end of the build to record what mojos are executed.
-
getMavenBuildInformation
MavenBuildInformation getMavenBuildInformation()
-
-