From 298be4830abf99dcc239e57e4351d9ea5fc643db Mon Sep 17 00:00:00 2001 From: Jeff Shaw Date: Thu, 29 Jun 2017 14:19:18 -0400 Subject: [PATCH] Fix bug where environmentVariables or systemProperties can contain non-Strings. Example: ${project.basedir} --- .../scalatest/tools/maven/AbstractScalaTestMojo.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/scalatest/tools/maven/AbstractScalaTestMojo.java b/src/main/java/org/scalatest/tools/maven/AbstractScalaTestMojo.java index b576678..db4494d 100644 --- a/src/main/java/org/scalatest/tools/maven/AbstractScalaTestMojo.java +++ b/src/main/java/org/scalatest/tools/maven/AbstractScalaTestMojo.java @@ -174,14 +174,14 @@ abstract class AbstractScalaTestMojo extends AbstractMojo { * * @parameter */ - Map environmentVariables; + Map environmentVariables; /** * Additional system properties to pass to the forked process. * * @parameter */ - Map systemProperties; + Map systemProperties; /** * Option to specify whether the forked process should wait at startup for a remote debugger to attach. @@ -274,15 +274,15 @@ private boolean runForkingOnce(String[] args) throws MojoFailureException { // Set up environment if (environmentVariables != null) { - for (final Map.Entry entry : environmentVariables.entrySet()) { - cli.addEnvironment(entry.getKey(), entry.getValue()); + for (final Map.Entry entry : environmentVariables.entrySet()) { + cli.addEnvironment(entry.getKey(), entry.getValue().toString()); } } cli.addEnvironment("CLASSPATH", buildClassPathEnvironment()); // Set up system properties if (systemProperties != null) { - for (final Map.Entry entry : systemProperties.entrySet()) { + for (final Map.Entry entry : systemProperties.entrySet()) { cli.createArg().setValue(String.format("-D%s=%s", entry.getKey(), entry.getValue())); } }