add a parameter to add jvm args

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
This commit is contained in:
olivier lamy 2020-04-29 14:11:41 +10:00
parent 1b5ad92d36
commit c5f8cf2f6a
1 changed files with 16 additions and 1 deletions

View File

@ -150,6 +150,10 @@ public class DistributionTester
List<String> commands = new ArrayList<>();
commands.add(getJavaExecutable());
if (!config.jvmArgs.isEmpty())
{
commands.addAll(config.jvmArgs);
}
commands.add("-Djava.io.tmpdir=" + workDir.toAbsolutePath().toString());
commands.add("-jar");
commands.add(config.jettyHome.toAbsolutePath() + "/start.jar");
@ -371,7 +375,7 @@ public class DistributionTester
private String jettyVersion;
private String mavenLocalRepository = System.getProperty("user.home") + "/.m2/repository";
private Map<String, String> mavenRemoteRepositories = new HashMap<>();
private Path logFile;
private List<String> jvmArgs = new ArrayList<>();
@Override
public String toString()
@ -701,6 +705,17 @@ public class DistributionTester
return this;
}
/**
*
* @param jvmArgs the jvm args to add
* @return the {@link Builder}
*/
public Builder jvmArgs(List<String> jvmArgs)
{
config.jvmArgs = jvmArgs;
return this;
}
/**
* @return an empty instance of {@link Builder}
*/