Skip to content

Best practice for designing Auto-Configuration based on Spring Boot generation #12941

@ruifigueira

Description

@ruifigueira

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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions