- Mastering Spring Boot 2.0
- Dinesh Rajput
- 125字
- 2021-06-25 21:29:15
Disabling specific auto-configuration classes
At any point in time, if you don't want to use some of the specific auto-configuration classes or if they don't suit your needs, you can disable those auto-configuration classes. For this, you can use the exclude attribute of the @EnableAutoConfiguration annotation. Let's see the following example:
@EnableAutoConfiguration(exclude=DataSourceAutoConfiguration.class) public class ApplicationConfiguration { ... }
As per the code snippet, we have used the @EnableAutoConfiguration annotation with the exclude attribute. The DataSourceAutoConfiguration class will be excluded from the auto-configuration. Similarly, we can define a list of auto-configuration classes that need to be excluded.
You can define exclusions both at the annotation level and by using the property.
Let's move to another point of customizing auto-configuration in the Spring Boot application.
- Word排版技術(shù)大全(第2版)
- Word/Excel/PPT 2013辦公應(yīng)用從入門到精通
- Excel職場辦公:表格范例大全
- Keynote:超越PPT的蘋果商業(yè)幻燈片(第2版)
- Excel財務(wù)會計應(yīng)用
- Excel 2013應(yīng)用技巧實例大全
- 非常Easy:Office高效辦公
- 零基礎(chǔ)入門Python游戲
- Office 2021辦公應(yīng)用實戰(zhàn)從入門到精通
- 文秘辦公自動化培訓(xùn)教程
- Excel數(shù)據(jù)處理與統(tǒng)計初步(第4版)
- iLike蘋果Office 2011 for Mac辦公應(yīng)用
- Unity3D平臺AR與VR開發(fā)快速上手
- Word\Excel\PowerPoint2013三合一高效辦公應(yīng)用/微課堂學(xué)電腦
- 從數(shù)據(jù)到Excel自動化報表:Power Query和Power Pivot實戰(zhàn)