Skip to content

Commit bf86733

Browse files
committed
2 parents 9f95d7f + 2126538 commit bf86733

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/main/java/org/scalatest/tools/maven/AbstractScalaTestMojo.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,14 @@ abstract class AbstractScalaTestMojo extends AbstractMojo {
234234
*/
235235
String workingDirectory;
236236

237+
/**
238+
* Option to specify an alternative path to JVM (or path to the java executable) to use with
239+
* the forked process.
240+
*
241+
* @parameter property="jvm"
242+
*/
243+
String jvm;
244+
237245
// runScalaTest is called by the concrete mojo subclasses TODO: make it protected and others too
238246
// Returns true if all tests pass
239247
boolean runScalaTest(String[] args) throws MojoFailureException {
@@ -274,7 +282,12 @@ private boolean runForkingOnce(String[] args) throws MojoFailureException {
274282
} else {
275283
cli.setWorkingDirectory(workingDirectory);
276284
}
277-
cli.setExecutable(getJvm());
285+
286+
if (this.jvm == null || this.jvm.isEmpty()) {
287+
cli.setExecutable(getJvm());
288+
} else {
289+
cli.setExecutable(this.jvm);
290+
}
278291

279292
// Set up environment
280293
if (environmentVariables != null) {

0 commit comments

Comments
 (0)