hudson.maven
Class AbstractMavenBuilder

java.lang.Object
  extended by hudson.maven.AbstractMavenBuilder
All Implemented Interfaces:
hudson.remoting.Callable<Result,IOException>, hudson.remoting.DelegatingCallable<Result,IOException>, Serializable
Direct Known Subclasses:
Maven3Builder, MavenBuilder

public abstract class AbstractMavenBuilder
extends Object
implements hudson.remoting.DelegatingCallable<Result,IOException>

Author:
Olivier Lamy, Christoph Kutzinski
See Also:
Serialized Form

Nested Class Summary
protected static class AbstractMavenBuilder.FilterImpl
           
 
Field Summary
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
protected AbstractMavenBuilder(BuildListener listener, Collection<MavenModule> modules, List<String> goals, Map<String,String> systemProps)
           
 
Method Summary
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 the jenkins environment variables into the system properties Ignores jenkins environment variables with empty keys.
protected  Result waitForAsynchronousExecutions()
          Waits until all asynchronous executions are finished.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface hudson.remoting.Callable
call
 

Field Detail

goals

protected final List<String> goals
Goals to be executed in this Maven execution.


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

formatArgs

protected String formatArgs(List<String> args)

registerSystemProperties

protected void registerSystemProperties()
Add all the jenkins environment variables into the system properties Ignores jenkins environment variables with empty keys.

Throws:
IllegalArgumentException - if a jenkins environment variable has null value as it blows up Maven.
See Also:
http://jenkins.361315.n4.nabble.com/Upgrade-to-1-424-broke-our-Maven-builds-due-to-empty-system-property-key-td3726460.html

format

protected String format(NumberFormat n,
                        long nanoTime)

getClassLoader

public ClassLoader getClassLoader()
Specified by:
getClassLoader in interface hudson.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()


Copyright © 2004-2013. All Rights Reserved.