From a5f077cf793be9d14455a375f224e4749e687e6a Mon Sep 17 00:00:00 2001 From: Yanming Zhou Date: Thu, 17 Jun 2021 09:33:33 +0800 Subject: [PATCH 1/2] Update docs to use @SpringBootConfiguration not @Configuration See gh-26937 --- .../src/docs/asciidoc/using-spring-boot.adoc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/using-spring-boot.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/using-spring-boot.adoc index 915c0f1e73..90d4563b7d 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/using-spring-boot.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/using-spring-boot.adoc @@ -364,7 +364,7 @@ A single `@SpringBootApplication` annotation can be used to enable those three f * `@EnableAutoConfiguration`: enable <> * `@ComponentScan`: enable `@Component` scan on the package where the application is located (see <>) -* `@Configuration`: allow to register extra beans in the context or import additional configuration classes +* `@SpringBootConfiguration`: an alternative to Spring's standard `@Configuration`, allow to register extra beans in the context or import additional configuration classes [source,java,indent=0] ---- @@ -373,7 +373,7 @@ A single `@SpringBootApplication` annotation can be used to enable those three f import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; - @SpringBootApplication // same as @Configuration @EnableAutoConfiguration @ComponentScan + @SpringBootApplication // same as @SpringBootConfiguration @EnableAutoConfiguration @ComponentScan public class Application { public static void main(String[] args) { @@ -395,11 +395,11 @@ For instance, you may not want to use component scan or configuration properties package com.example.myapplication; import org.springframework.boot.SpringApplication; + import org.springframework.boot.SpringBootConfiguration; import org.springframework.context.annotation.ComponentScan - import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; - @Configuration(proxyBeanMethods = false) + @SpringBootConfiguration(proxyBeanMethods = false) @EnableAutoConfiguration @Import({ MyConfig.class, MyAnotherConfig.class }) public class Application { From ba9244b2d463a80f9d55326c40e26e286f1c88d7 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Tue, 22 Jun 2021 11:59:56 +0100 Subject: [PATCH 2/2] Polish "Update docs to use @SpringBootConfiguration not @Configuration" See gh-26937 --- .../spring-boot-docs/src/docs/asciidoc/using-spring-boot.adoc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/using-spring-boot.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/using-spring-boot.adoc index 90d4563b7d..72cb1e013b 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/using-spring-boot.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/using-spring-boot.adoc @@ -364,7 +364,8 @@ A single `@SpringBootApplication` annotation can be used to enable those three f * `@EnableAutoConfiguration`: enable <> * `@ComponentScan`: enable `@Component` scan on the package where the application is located (see <>) -* `@SpringBootConfiguration`: an alternative to Spring's standard `@Configuration`, allow to register extra beans in the context or import additional configuration classes +* `@SpringBootConfiguration`: enable registration of extra beans in the context or the import of additional configuration classes. +An alternative to Spring's standard `@Configuration` that aids <> in your integration tests. [source,java,indent=0] ----