file for registering auto-configurations, while maintaining backwards compatibility with registration in spring.factories
The autoconfiguration file has changed from spring.factories in Spring Boot 2.x to META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports in Spring Boot 3.x. We can support both by keeping both files updated in the library.
Spring Boot 3.x changes ResponseEntity where HttpStatus was changed to a new HttpStatusCode interface. There is not way to support both of these interfaces above, but we can use the ResponseEntity constructor that builds from a raw status int and it will work in both Spring Boot versions.
Unfortunately, this seems like it might be a losing battle based on this issue, which indicates it's not intended or supported to build a library that supports both. I'm hesitant to drop Spring Boot 2.x support because it'll cut out a lot of existing projects that I'd like to enable SCI measurements for (not just recently created or updated projects). We'll need to figure out a strategy for this in the future, but for now this refactor seems to work.
Closes #40
I've got this working and it's a combination of:
file for registering auto-configurations, while maintaining backwards compatibility with registration in spring.factories
spring.factories
in Spring Boot 2.x toMETA-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
in Spring Boot 3.x. We can support both by keeping both files updated in the library.Unfortunately, this seems like it might be a losing battle based on this issue, which indicates it's not intended or supported to build a library that supports both. I'm hesitant to drop Spring Boot 2.x support because it'll cut out a lot of existing projects that I'd like to enable SCI measurements for (not just recently created or updated projects). We'll need to figure out a strategy for this in the future, but for now this refactor seems to work.