diff --git a/spring-boot-cli/src/main/java/org/springframework/boot/cli/SpringCli.java b/spring-boot-cli/src/main/java/org/springframework/boot/cli/SpringCli.java
index f1a5a4fc8a..0e7374063d 100644
--- a/spring-boot-cli/src/main/java/org/springframework/boot/cli/SpringCli.java
+++ b/spring-boot-cli/src/main/java/org/springframework/boot/cli/SpringCli.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2012-2013 the original author or authors.
+ * Copyright 2012-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -90,6 +90,7 @@ public class SpringCli {
* @return a return status code (non boot is used to indicate an error)
*/
public int runAndHandleErrors(String... args) {
+ System.setProperty("java.awt.headless", Boolean.toString(true));
String[] argsWithoutDebugFlags = removeDebugFlags(args);
boolean debug = argsWithoutDebugFlags.length != args.length;
try {
diff --git a/spring-boot-parent/pom.xml b/spring-boot-parent/pom.xml
index ef6f3f6969..18f6e40b86 100644
--- a/spring-boot-parent/pom.xml
+++ b/spring-boot-parent/pom.xml
@@ -359,6 +359,7 @@
file:/dev/./urandom
+ true-Xmx1024m -XX:MaxPermSize=256m
diff --git a/spring-boot-samples/pom.xml b/spring-boot-samples/pom.xml
index a10fd482fe..5c7fd07c4d 100644
--- a/spring-boot-samples/pom.xml
+++ b/spring-boot-samples/pom.xml
@@ -72,6 +72,21 @@
+
+ maven-surefire-plugin
+
+
+ **/*Tests.java
+
+
+ **/Abstract*.java
+
+
+ file:/dev/./urandom
+ true
+
+
+
diff --git a/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java b/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java
index 42e3b3c8b7..6e6c285d50 100644
--- a/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java
+++ b/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2012-2013 the original author or authors.
+ * Copyright 2012-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -177,6 +177,8 @@ public class SpringApplication {
private boolean webEnvironment;
+ private boolean headless = true;
+
private Set> initializers;
private Set> listeners;
@@ -305,6 +307,8 @@ public class SpringApplication {
stopWatch.start();
ConfigurableApplicationContext context = null;
+ System.setProperty("java.awt.headless", Boolean.toString(this.headless));
+
ApplicationEventMulticaster multicaster = createApplicationEventMulticaster();
try {
Set