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
Nested ClassesModifier and TypeClassDescriptionprotected static final classstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic intIf not 0, launch Maven with a debugger port.static final Stringstatic booleanstatic booleanIf true, launch Maven with YJP offline profiler agent. -
Method Summary
Modifier and TypeMethodDescriptionprotected StringaddRunHeadLessOption(String mavenOpts) protected abstract voidapplyPlexusModuleContributor(hudson.remoting.Channel channel, AbstractMavenBuild<?, ?> context) Apply extension plexus modules to the newly launched Maven process.protected ArgumentListBuilderbuildMavenAgentCmdLine(BuildListener listener, String tcpSocket) Builds the command line argument list to launch the maven process.protected final StringclassPathEntry(FilePath root, Class<?> representative, String seedName, TaskListener listener) Copies a Maven-related JAR to the agent on demand.protected NodeReturns the currentNodeon which we are buildling.protected EnvVarsgetJava(TaskListener log) protected Launcherprotected abstract StringReturns the name of the Maven main class.protected abstract StringgetMavenAgentClassPath(Maven.MavenInstallation mvn, FilePath slaveRoot, BuildListener listener) Returns the classpath string for the maven-agent jar including classworldsprotected abstract StringgetMavenInterceptorClassPath(Maven.MavenInstallation mvn, FilePath slaveRoot, BuildListener listener) Returns the classpath string for the maven-interceptor jarprotected StringgetMavenInterceptorCommonClassPath(Maven.MavenInstallation mvn, FilePath slaveRoot, BuildListener listener) Returns the classpath string for the maven-interceptor jarprotected abstract StringgetMavenInterceptorOverride(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 MavenModuleSetnewProcess(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:
IOExceptionInterruptedException
-
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 thatPlexusModuleContributorneeds to figure out what it needs to do.- Throws:
InterruptedExceptionIOException- 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:
IOExceptionInterruptedException
-
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:
IOExceptionInterruptedException
-
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:
IOExceptionInterruptedException
-
getMavenInterceptorCommonClassPath
protected String getMavenInterceptorCommonClassPath(Maven.MavenInstallation mvn, FilePath slaveRoot, BuildListener listener) throws IOException, InterruptedException Returns the classpath string for the maven-interceptor jar- Throws:
IOExceptionInterruptedException- 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:
IOExceptionInterruptedException
-
getMainClassName
Returns the name of the Maven main class. -
getMavenOpts
-
addRunHeadLessOption
-
getMavenInstallation
public Maven.MavenInstallation getMavenInstallation(TaskListener log) throws IOException, InterruptedException - Throws:
IOExceptionInterruptedException
-
getJava
- Throws:
IOExceptionInterruptedException
-
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 currentNodeon which we are buildling. -
getMavenModuleSet
-
getLauncher
-
getEnvVars
-