Package hudson.maven
Class AbstractMavenProcessFactory
java.lang.Object
hudson.maven.AbstractMavenProcessFactory
- Direct Known Subclasses:
Maven3ProcessFactory
Launches the maven process.
This class captures the common part, and
MavenProcessFactory
and Maven3ProcessFactory
adds Maven2/Maven3 flavors to it to make it concrete.- Author:
- Olivier Lamy
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static final class
static class
-
Field Summary
Modifier and TypeFieldDescriptionstatic int
If not 0, launch Maven with a debugger port.static final String
static boolean
static boolean
If true, launch Maven with YJP offline profiler agent. -
Method Summary
Modifier and TypeMethodDescriptionprotected String
addRunHeadLessOption
(String mavenOpts) protected abstract void
applyPlexusModuleContributor
(hudson.remoting.Channel channel, AbstractMavenBuild<?, ?> context) Apply extension plexus modules to the newly launched Maven process.protected ArgumentListBuilder
buildMavenAgentCmdLine
(BuildListener listener, String tcpSocket) Builds the command line argument list to launch the maven process.protected final String
classPathEntry
(FilePath root, Class<?> representative, String seedName, TaskListener listener) Copies a Maven-related JAR to the agent on demand.protected Node
Returns the currentNode
on which we are buildling.protected EnvVars
getJava
(TaskListener log) protected Launcher
protected abstract String
Returns the name of the Maven main class.protected abstract String
getMavenAgentClassPath
(Maven.MavenInstallation mvn, FilePath slaveRoot, BuildListener listener) Returns the classpath string for the maven-agent jar including classworldsprotected abstract String
getMavenInterceptorClassPath
(Maven.MavenInstallation mvn, FilePath slaveRoot, BuildListener listener) Returns the classpath string for the maven-interceptor jarprotected String
getMavenInterceptorCommonClassPath
(Maven.MavenInstallation mvn, FilePath slaveRoot, BuildListener listener) Returns the classpath string for the maven-interceptor jarprotected abstract String
getMavenInterceptorOverride
(Maven.MavenInstallation mvn, FilePath slaveRoot, BuildListener listener) For Maven 2.1.x - 2.2.x we need an additional jar which overrides some classes in the other interceptor jar.protected MavenModuleSet
newProcess
(BuildListener listener, OutputStream out) Starts maven process.
-
Field Details
-
mavenRemoteUseInet
public static boolean mavenRemoteUseInet -
MAVEN_REMOTE_USEINET_ENV_VAR_NAME
- See Also:
-
yjp
public static boolean yjpIf true, launch Maven with YJP offline profiler agent. -
debugPort
public static int debugPortIf not 0, launch Maven with a debugger port.
-
-
Method Details
-
newProcess
public ProcessCache.NewProcess newProcess(BuildListener listener, OutputStream out) throws IOException, InterruptedException Starts maven process.- Throws:
IOException
InterruptedException
-
applyPlexusModuleContributor
protected abstract void applyPlexusModuleContributor(hudson.remoting.Channel channel, AbstractMavenBuild<?, ?> context) throws InterruptedException, IOExceptionApply extension plexus modules to the newly launched Maven process.- Parameters:
channel
- Channel to the Maven process.context
- Context thatPlexusModuleContributor
needs to figure out what it needs to do.- Throws:
InterruptedException
IOException
- Since:
- 1.519
-
buildMavenAgentCmdLine
protected ArgumentListBuilder buildMavenAgentCmdLine(BuildListener listener, String tcpSocket) throws IOException, InterruptedException Builds the command line argument list to launch the maven process.- Throws:
IOException
InterruptedException
-
getMavenAgentClassPath
protected abstract String getMavenAgentClassPath(Maven.MavenInstallation mvn, FilePath slaveRoot, BuildListener listener) throws IOException, InterruptedException Returns the classpath string for the maven-agent jar including classworlds- Throws:
IOException
InterruptedException
-
getMavenInterceptorClassPath
protected abstract String getMavenInterceptorClassPath(Maven.MavenInstallation mvn, FilePath slaveRoot, BuildListener listener) throws IOException, InterruptedException Returns the classpath string for the maven-interceptor jar- Throws:
IOException
InterruptedException
-
getMavenInterceptorCommonClassPath
protected String getMavenInterceptorCommonClassPath(Maven.MavenInstallation mvn, FilePath slaveRoot, BuildListener listener) throws IOException, InterruptedException Returns the classpath string for the maven-interceptor jar- Throws:
IOException
InterruptedException
- Since:
- 1.525
-
getMavenInterceptorOverride
protected abstract String getMavenInterceptorOverride(Maven.MavenInstallation mvn, FilePath slaveRoot, BuildListener listener) throws IOException, InterruptedException For Maven 2.1.x - 2.2.x we need an additional jar which overrides some classes in the other interceptor jar.- Throws:
IOException
InterruptedException
-
getMainClassName
Returns the name of the Maven main class. -
getMavenOpts
-
addRunHeadLessOption
-
getMavenInstallation
public Maven.MavenInstallation getMavenInstallation(TaskListener log) throws IOException, InterruptedException - Throws:
IOException
InterruptedException
-
getJava
- Throws:
IOException
InterruptedException
-
classPathEntry
protected final String classPathEntry(FilePath root, Class<?> representative, String seedName, TaskListener listener) throws IOException, InterruptedException Copies a Maven-related JAR to the agent on demand. Can also be used when run on controller.- Parameters:
root
- the FS root of the agent (null means running on the built-in node)representative
- a representative class present in the JARseedName
- the basename of the JARlistener
- a listener for any problems- Returns:
- the (local or remote) absolute path of the JAR
- Throws:
IOException
- in case copying failsInterruptedException
- in case copying is interrupted- Since:
- 1.530
-
getCurrentNode
Returns the currentNode
on which we are buildling. -
getMavenModuleSet
-
getLauncher
-
getEnvVars
-