Update 16.2. Disabling specific auto-configuration.md
parent
f79edc59f3
commit
2824f1d50b
|
@ -0,0 +1,13 @@
|
|||
### 16.2. 禁用特定的自动配置
|
||||
|
||||
如果发现应用了你不想要的特定自动配置类,你可以使用`@EnableAutoConfiguration`注解的排除属性来禁用它们。
|
||||
```java
|
||||
import org.springframework.boot.autoconfigure.*;
|
||||
import org.springframework.boot.autoconfigure.jdbc.*;
|
||||
import org.springframework.context.annotation.*;
|
||||
|
||||
@Configuration
|
||||
@EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class})
|
||||
public class MyConfiguration {
|
||||
}
|
||||
```
|
Loading…
Reference in New Issue