May 2018
Intermediate to advanced
390 pages
9h 31m
English
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.
Read now
Unlock full access