Skip to content

Commit 650e55c

Browse files
committed
Polish "Encourage use of SpringBootApplication"
See gh-19855
1 parent 3131616 commit 650e55c

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

spring-boot-project/spring-boot-docs/src/main/asciidoc/using-spring-boot.adoc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -403,15 +403,14 @@ If you find that specific auto-configuration classes that you do not want are be
403403
----
404404
import org.springframework.boot.autoconfigure.*;
405405
import org.springframework.boot.autoconfigure.jdbc.*;
406-
import org.springframework.context.annotation.*;
407406
408-
@Configuration
409407
@SpringBootApplication(exclude={DataSourceAutoConfiguration.class})
410-
public class MyConfiguration {
408+
public class MyApplication {
411409
}
412410
----
413411

414-
If you choose to use `@EnableAutoConfiguration` rather than `@SpringBootApplication`, please note that it also has an `exclude` attribute that can be used. If the class is not on the classpath, you can use the `excludeName` attribute of the annotation and specify the fully qualified name instead.
412+
If the class is not on the classpath, you can use the `excludeName` attribute of the annotation and specify the fully qualified name instead.
413+
If you prefer to use `@EnableAutoConfiguration` rather than `@SpringBootApplication`, `exclude` and `excludeName` are also available.
415414
Finally, you can also control the list of auto-configuration classes to exclude by using the `spring.autoconfigure.exclude` property.
416415

417416
TIP: You can define exclusions both at the annotation level and by using the property.

0 commit comments

Comments
 (0)