public class SpincastProcessUtilsDefault extends Object implements SpincastProcessUtils
| Constructor and Description |
|---|
SpincastProcessUtilsDefault(SpincastConfig spincastConfig,
SpincastUtils spincastUtils,
TemplatingEngine templatingEngine) |
| Modifier and Type | Method and Description |
|---|---|
File |
executeGoalOnExternalMavenProject(ResourceInfo projectRootInfo,
MavenProjectGoal mavenGoal)
Execute the specified goal on an external Maven project.
|
File |
executeGoalOnExternalMavenProject(ResourceInfo projectRootInfo,
MavenProjectGoal mavenGoal,
Map<String,Object> pomParams)
Execute the specified goal on an external Maven project.
|
void |
executeJar(String jarFilePath,
List<String> args,
JarExecutionHandler handler)
Run an executable
.jar by passing the
specified arguments. |
void |
executeJar(String javaBinPath,
String jarFilePath,
List<String> args,
JarExecutionHandler handler)
Run an executable
.jar by passing the
specified arguments. |
protected SpincastConfig |
getSpincastConfig() |
protected SpincastUtils |
getSpincastUtils() |
protected TemplatingEngine |
getTemplatingEngine() |
@Inject public SpincastProcessUtilsDefault(SpincastConfig spincastConfig, SpincastUtils spincastUtils, TemplatingEngine templatingEngine)
protected SpincastConfig getSpincastConfig()
protected SpincastUtils getSpincastUtils()
protected TemplatingEngine getTemplatingEngine()
public File executeGoalOnExternalMavenProject(ResourceInfo projectRootInfo, MavenProjectGoal mavenGoal)
SpincastProcessUtilsIf the project is located on the classpath, it first copies it to the file system (in a temp folder).
executeGoalOnExternalMavenProject in interface SpincastProcessUtilspublic File executeGoalOnExternalMavenProject(ResourceInfo projectRootInfo, MavenProjectGoal mavenGoal, Map<String,Object> pomParams)
SpincastProcessUtilsIf the project is located on the classpath, it first copies it to the file system (in a temp folder).
executeGoalOnExternalMavenProject in interface SpincastProcessUtilspomParams - Before executing the goal, those parameters
are used to replace placeholders in the project's pom.xml
using Spincast's TemplatingEngine.public void executeJar(String jarFilePath, List<String> args, JarExecutionHandler handler)
SpincastProcessUtils.jar by passing the
specified arguments.
If the process is not made to die automatically (for example it starts an HTTP server), you must kill the process by yourself!:
JarExecutionHandlerDefault handler = new JarExecutionHandlerDefault();
getSpincastProcessUtils().executeJar(jarFile.getAbsolutePath(),
Lists.newArrayList(),
handler);
try {
//...
} finally {
handler.killJarProcess();
}
executeJar in interface SpincastProcessUtilspublic void executeJar(String javaBinPath, String jarFilePath, List<String> args, JarExecutionHandler handler)
SpincastProcessUtils.jar by passing the
specified arguments.
If the process is not made to die automatically (for example it starts an HTTP server), you must kill the process by yourself!:
JarExecutionHandlerDefault handler = new JarExecutionHandlerDefault();
getSpincastProcessUtils().executeJar(jarFile.getAbsolutePath(),
Lists.newArrayList(),
handler);
try {
//...
} finally {
handler.killJarProcess();
}
executeJar in interface SpincastProcessUtilsjavaBinPath - The path to the java
executable to use.Copyright © 2019. All rights reserved.