As part of an effort to support both Spring Boot 1.5 and 2.0 for Togglz (togglz/togglz#271) I have two equivalent AutoConfiguration classes that are Spring Boot version dependent, and so I'm using @ConditionalOnClass annotations with Spring boot version specific classes as parameter to only load the right AutoConfiguration class.
I would like to know if there is a best practice for this, or if my approach is acceptable.
I'm aware that supporting different Spring Boot versions is actually being contemplated (#12733), so it would be great if documentation also include guidelines on how to achieve that.