|
|
|
@ -16,6 +16,9 @@
|
|
|
|
|
|
|
|
|
|
package org.springframework.boot.gradle.tasks.run;
|
|
|
|
|
|
|
|
|
|
import java.lang.reflect.Method;
|
|
|
|
|
|
|
|
|
|
import org.gradle.api.JavaVersion;
|
|
|
|
|
import org.gradle.api.file.SourceDirectorySet;
|
|
|
|
|
import org.gradle.api.tasks.Input;
|
|
|
|
|
import org.gradle.api.tasks.JavaExec;
|
|
|
|
@ -69,7 +72,11 @@ public class BootRun extends JavaExec {
|
|
|
|
|
public void exec() {
|
|
|
|
|
if (this.optimizedLaunch) {
|
|
|
|
|
setJvmArgs(getJvmArgs());
|
|
|
|
|
jvmArgs("-Xverify:none", "-XX:TieredStopAtLevel=1");
|
|
|
|
|
JavaVersion.current();
|
|
|
|
|
if (!isJava13OrLater()) {
|
|
|
|
|
jvmArgs("-Xverify:none");
|
|
|
|
|
}
|
|
|
|
|
jvmArgs("-XX:TieredStopAtLevel=1");
|
|
|
|
|
}
|
|
|
|
|
if (System.console() != null) {
|
|
|
|
|
// Record that the console is available here for AnsiOutput to detect later
|
|
|
|
@ -78,4 +85,13 @@ public class BootRun extends JavaExec {
|
|
|
|
|
super.exec();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private boolean isJava13OrLater() {
|
|
|
|
|
for (Method method : String.class.getMethods()) {
|
|
|
|
|
if (method.getName().equals("stripIndent")) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|