org.hudsonci.maven.plugin.builder.internal
Class MavenProcessBuilder

java.lang.Object
  extended by org.hudsonci.maven.plugin.builder.internal.MavenProcessBuilder

public class MavenProcessBuilder
extends Object

Helper to build the arguments and environment for launching Maven.

Since:
2.1.0
Author:
Jason Dillon

Field Summary
static String[] BANNED_OPTIONS
          Banned options, users should be warned when configuring these via goals or mavenOpts, as this will prevent the integration from functioning correctly.
static String[] BANNED_PROPERTIES
          Banned properties (prefixes in arg form), users should be warned when configuring these via goals or mavenOpts, as they may prevent the integration from functioning correctly.
static String[] SUPERFLUOUS_OPTIONS
          Superfluous options, users should be warned when configuring these via goals or mavenOpts, as they are pointless.
 
Constructor Summary
MavenProcessBuilder(Logger log)
           
 
Method Summary
 Launcher.ProcStarter build(Launcher.ProcStarter starter)
          Build the process starter.
 ArgumentListBuilder buildArguments()
          Build the arguments.
 EnvVars buildEnv()
          Build the environment.
 ArgumentListBuilder buildOpts()
          Build MAVEN_OPTS values.
 boolean detectBannedProperties(ArgumentListBuilder args)
          Complain if any banned properties were configured.
protected  String resolve(String value)
          Allows sub-class to perform variable resolution.
 MavenProcessBuilder withBuildVariables(Map<String,String> variables)
           
 MavenProcessBuilder withConfiguration(BuildConfigurationDTO config)
           
 MavenProcessBuilder withEnv(EnvVars env)
           
 MavenProcessBuilder withExtClasspath(ClasspathBuilder classpath)
           
 MavenProcessBuilder withMavenExecutable(FilePath file)
           
 MavenProcessBuilder withMavenHome(FilePath dir)
           
 MavenProcessBuilder withPort(int port)
           
 MavenProcessBuilder withRepository(FilePath dir)
           
 MavenProcessBuilder withStandardOutput(OutputStream output)
           
 MavenProcessBuilder withTmpDir(FilePath dir)
           
 MavenProcessBuilder withWindows(boolean flag)
           
 MavenProcessBuilder withWorkingDirectory(FilePath dir)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SUPERFLUOUS_OPTIONS

public static final String[] SUPERFLUOUS_OPTIONS
Superfluous options, users should be warned when configuring these via goals or mavenOpts, as they are pointless.


BANNED_OPTIONS

public static final String[] BANNED_OPTIONS
Banned options, users should be warned when configuring these via goals or mavenOpts, as this will prevent the integration from functioning correctly.


BANNED_PROPERTIES

public static final String[] BANNED_PROPERTIES
Banned properties (prefixes in arg form), users should be warned when configuring these via goals or mavenOpts, as they may prevent the integration from functioning correctly.

Constructor Detail

MavenProcessBuilder

public MavenProcessBuilder(Logger log)
Method Detail

withWindows

public MavenProcessBuilder withWindows(boolean flag)

withTmpDir

public MavenProcessBuilder withTmpDir(FilePath dir)

withMavenHome

public MavenProcessBuilder withMavenHome(FilePath dir)

withMavenExecutable

public MavenProcessBuilder withMavenExecutable(FilePath file)

withExtClasspath

public MavenProcessBuilder withExtClasspath(ClasspathBuilder classpath)

withRepository

public MavenProcessBuilder withRepository(FilePath dir)

withBuildVariables

public MavenProcessBuilder withBuildVariables(Map<String,String> variables)

withEnv

public MavenProcessBuilder withEnv(EnvVars env)

withPort

public MavenProcessBuilder withPort(int port)

withConfiguration

public MavenProcessBuilder withConfiguration(BuildConfigurationDTO config)

withWorkingDirectory

public MavenProcessBuilder withWorkingDirectory(FilePath dir)

withStandardOutput

public MavenProcessBuilder withStandardOutput(OutputStream output)

resolve

protected String resolve(String value)
Allows sub-class to perform variable resolution. All textual user-inputs should pass though this method.


buildArguments

public ArgumentListBuilder buildArguments()
                                   throws Exception
Build the arguments.

Throws:
Exception

buildOpts

public ArgumentListBuilder buildOpts()
                              throws Exception
Build MAVEN_OPTS values.

Throws:
Exception

buildEnv

public EnvVars buildEnv()
                 throws Exception
Build the environment.

Throws:
Exception

build

public Launcher.ProcStarter build(Launcher.ProcStarter starter)
                           throws Exception
Build the process starter.

Throws:
Exception

detectBannedProperties

public boolean detectBannedProperties(ArgumentListBuilder args)
Complain if any banned properties were configured.



Copyright © 2004-2011 Hudson. All Rights Reserved.