From a5e9a38b76f3d50d85e0eeb64cd80266d9ac6ee2 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Mon, 11 May 2015 11:12:22 +0100 Subject: [PATCH] Clear JAVA_OPTS in CLI tests; avoid permsize config error with Java 8 When a Java 8 JMV is launched with -XX:MaxPermSize a warning message is output indicating that the option will be ignored. This causes the CLI tests that assert that no error output has been produced to fail. This commit updates the CLI's integration test harness to remove JAVA_OPTS from the environment of the CLI process. This prevents any unwanted max perm size configuration from leaking into that environment and breaking the build. --- .../boot/cli/infrastructure/CommandLineInvoker.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/spring-boot-cli/src/it/java/org/springframework/boot/cli/infrastructure/CommandLineInvoker.java b/spring-boot-cli/src/it/java/org/springframework/boot/cli/infrastructure/CommandLineInvoker.java index 2237e01ca0..9f4f28e62c 100644 --- a/spring-boot-cli/src/it/java/org/springframework/boot/cli/infrastructure/CommandLineInvoker.java +++ b/spring-boot-cli/src/it/java/org/springframework/boot/cli/infrastructure/CommandLineInvoker.java @@ -57,7 +57,10 @@ public final class CommandLineInvoker { List command = new ArrayList(); command.add(findLaunchScript().getAbsolutePath()); command.addAll(Arrays.asList(args)); - return new ProcessBuilder(command).directory(this.workingDirectory).start(); + ProcessBuilder processBuilder = new ProcessBuilder(command) + .directory(this.workingDirectory); + processBuilder.environment().remove("JAVA_OPTS"); + return processBuilder.start(); } private File findLaunchScript() {