mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Previously, if an application’s main method threw an exception, MainMethodRunner would catch the exception and call System.exit(1). This meant that the JVM would exit, irrespective of whether or not any non-daemon threads were running. In contrast, when an application’s main method was invoked directly (in an IDE, for example) the JVM would not exit if one or more non-daemon threads were running. This is standard JVM behaviour that we should be consistent with in the launcher. This commit updates MainMethodRunner to wrap any exception thrown by an application’s main method in a RuntimeException and rethrow it. This alllows the JVM to handle the exception and use its normal rules for deciding whether or not it should exit. Closes gh-4984 |
||
---|---|---|
.. | ||
spring-boot-antlib | ||
spring-boot-configuration-metadata | ||
spring-boot-configuration-processor | ||
spring-boot-gradle-plugin | ||
spring-boot-loader | ||
spring-boot-loader-tools | ||
spring-boot-maven-plugin | ||
pom.xml |