diff --git a/spring-boot-starters/spring-boot-starter-shell-remote/src/main/resources/commands/crash/autoconfig.groovy b/spring-boot-starters/spring-boot-starter-shell-remote/src/main/resources/commands/crash/autoconfig.groovy new file mode 100644 index 00000000000..3f4dc27beef --- /dev/null +++ b/spring-boot-starters/spring-boot-starter-shell-remote/src/main/resources/commands/crash/autoconfig.groovy @@ -0,0 +1,29 @@ +package commands + +import org.springframework.boot.actuate.endpoint.AutoConfigurationReportEndpoint + +class autoconfig { + + @Usage("Display auto configuration report from ApplicationContext") + @Command + void main(InvocationContext context) { + context.attributes['spring.beanfactory'].getBeansOfType(AutoConfigurationReportEndpoint.class).each { name, endpoint -> + def report = endpoint.invoke() + out.println "Endpoint: " + name + "\n\nPositive Matches:\n================\n" + report.positiveMatches.each { key, list -> + out.println key + ":" + list.each { mandc -> + out.println " " + mandc.condition + ": " + mandc.message + } + } + out.println "\nNegative Matches\n================\n" + report.negativeMatches.each { key, list -> + out.println key + ":" + list.each { mandc -> + out.println " " + mandc.condition + ": " + mandc.message + } + } + } + } + +} \ No newline at end of file diff --git a/spring-boot-starters/spring-boot-starter-shell-remote/src/main/resources/commands/crash/beans.groovy b/spring-boot-starters/spring-boot-starter-shell-remote/src/main/resources/commands/crash/beans.groovy new file mode 100644 index 00000000000..67fea1cada5 --- /dev/null +++ b/spring-boot-starters/spring-boot-starter-shell-remote/src/main/resources/commands/crash/beans.groovy @@ -0,0 +1,17 @@ +package commands + +import org.springframework.boot.actuate.endpoint.BeansEndpoint + +class beans { + + @Usage("Display beans in ApplicationContext") + @Command + def main(InvocationContext context) { + def result = [:] + context.attributes['spring.beanfactory'].getBeansOfType(BeansEndpoint.class).each { name, endpoint -> + result.put(name, endpoint.invoke()) + } + result.size() == 1 ? result.values()[0] : result + } + +} \ No newline at end of file