Package hudson.maven
Class AbstractMavenBuilder
- java.lang.Object
-
- jenkins.security.MasterToSlaveCallable<Result,IOException>
-
- hudson.maven.AbstractMavenBuilder
-
- All Implemented Interfaces:
hudson.remoting.Callable<Result,IOException>
,hudson.remoting.DelegatingCallable<Result,IOException>
,Serializable
,org.jenkinsci.remoting.RoleSensitive
- Direct Known Subclasses:
Maven3Builder
,MavenBuilder
public abstract class AbstractMavenBuilder extends MasterToSlaveCallable<Result,IOException> implements hudson.remoting.DelegatingCallable<Result,IOException>
- Author:
- Olivier Lamy, Christoph Kutzinski
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
AbstractMavenBuilder.FilterImpl
-
Field Summary
Fields Modifier and Type Field Description protected List<hudson.remoting.Future<?>>
futures
Record all asynchronous executions as they are scheduled, to make sure they are all completed before we finish.protected List<String>
goals
Goals to be executed in this Maven execution.protected BuildListener
listener
Where error messages and so on are sent.protected Map<ModuleName,AbstractMavenBuilder.FilterImpl>
proxies
protected Map<ModuleName,List<MavenReporter>>
reporters
protected Map<ModuleName,MavenBuild.ProxyImpl2>
sourceProxies
Kept so that we can finalize them in the end method.protected Map<String,String>
systemProps
Hudson-defined system properties.
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractMavenBuilder(BuildListener listener, Collection<MavenModule> modules, List<String> goals, Map<String,String> systemProps)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
format(NumberFormat n, long nanoTime)
protected String
formatArgs(List<String> args)
ClassLoader
getClassLoader()
protected void
initializeAsynchronousExecutions()
Initialize the collection of the asynchronous executions.protected boolean
isDebug()
protected boolean
isQuiet()
protected void
recordAsynchronousExecution(hudson.remoting.Future<?> future)
Records a new asynchronous exection.protected void
registerSystemProperties()
Add all thejenkins environment variables
into thesystem properties
Ignoresjenkins environment variables
with empty keys.protected Result
waitForAsynchronousExecutions()
Waits until all asynchronous executions are finished.-
Methods inherited from class jenkins.security.MasterToSlaveCallable
checkRoles
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Field Detail
-
systemProps
protected final Map<String,String> systemProps
Hudson-defined system properties. These will be made available to Maven, and accessible as if they are specified as -Dkey=value
-
listener
protected final BuildListener listener
Where error messages and so on are sent.
-
proxies
protected Map<ModuleName,AbstractMavenBuilder.FilterImpl> proxies
-
sourceProxies
protected final transient Map<ModuleName,MavenBuild.ProxyImpl2> sourceProxies
Kept so that we can finalize them in the end method.
-
reporters
protected final Map<ModuleName,List<MavenReporter>> reporters
-
futures
protected transient List<hudson.remoting.Future<?>> futures
Record all asynchronous executions as they are scheduled, to make sure they are all completed before we finish.
-
-
Constructor Detail
-
AbstractMavenBuilder
protected AbstractMavenBuilder(BuildListener listener, Collection<MavenModule> modules, List<String> goals, Map<String,String> systemProps)
-
-
Method Detail
-
registerSystemProperties
protected void registerSystemProperties()
Add all thejenkins environment variables
into thesystem properties
Ignoresjenkins environment variables
with empty keys.- Throws:
IllegalArgumentException
- if ajenkins environment variable
has null value as it blows up Maven.- See Also:
- Upgrade to 1.424 broke our Maven builds due to empty system property key
-
format
protected String format(NumberFormat n, long nanoTime)
-
getClassLoader
public ClassLoader getClassLoader()
- Specified by:
getClassLoader
in interfacehudson.remoting.DelegatingCallable<Result,IOException>
-
initializeAsynchronousExecutions
protected void initializeAsynchronousExecutions()
Initialize the collection of the asynchronous executions. The method must be called in the Maven jail process i.e. inside the call method!
-
recordAsynchronousExecution
protected void recordAsynchronousExecution(hudson.remoting.Future<?> future)
Records a new asynchronous exection.
-
waitForAsynchronousExecutions
protected Result waitForAsynchronousExecutions()
Waits until all asynchronous executions are finished.- Returns:
- null in success case; returns an ABORT result if we were interrupted while waiting
-
isDebug
protected boolean isDebug()
-
isQuiet
protected boolean isQuiet()
-
-