I\'m having some difficulty preventing Spring Boot from auto configuring some classes (in this example: SolrAutoConfiguration). To illustrate I\'ve setup a much reduced exam
Currently I think it's not possible. The issues gh-2939 and gh-2435 relate to exactly this problem.
Spring Boot 1.3.0.M3 introduced functionality to exclude autoconfiguration using properties: https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-1.3.0-M3-Release-Notes
spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.solr.SolrAutoConfiguration
Note that it should say spring.autoconfigure.exclude
, not excludes
as in the release notes.
This helps prevent Spring Boot from loading autoconfig classes in the presence of multiple @EnableAutoConfiguration
/@SpringBootApplication
annotations.