-
Notifications
You must be signed in to change notification settings - Fork 41.4k
Closed as not planned
Closed as not planned
Copy link
Labels
status: declinedA suggestion or change that we don't feel we should currently applyA suggestion or change that we don't feel we should currently apply
Description
While working on migrating our internal library to be based on the upcoming Spring Boot 4, I encountered issues with the following:
@ConditionalOnClass(ObservationRegistry.class)
@AutoConfiguration
public final class ExampleObservationAutoConfiguration {
@Configuration(proxyBeanMethods = false)
@AutoConfigureAfter(WebMvcObservationAutoConfiguration.class)
@ConditionalOnClass(MeterRegistry.class)
@ConditionalOnWebApplication(type = Type.SERVLET)
static final class ExampleMetricsLoggingConfiguration {
}
}
I understand the modules have moved around, so the import issue related to WebMvcObservationAutoConfiguration
not being found is expected. But while looking at the changes for Spring Boot 4, specifically #32883, I can't help but wonder if the contract for @AutoConfigureAfter
/@AutoConfigureBefore
should be updated to accept a String by default rather than the class.
but users should reference only the names of these classes.
If that is the case, then presuming this means a String
rather than Class
, then the annotations should become:
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.TYPE })
@Documented
public @interface AutoConfigureAfter {
String[] value() default {};
}
Dropping references to Class
entirely so then this is possible:
@AutoConfigureAfter("com.example.ExampleAutoConfiguation")
instead of:
@AutoConfigureAfter(name = "com.example.ExampleAutoConfiguation")
Metadata
Metadata
Assignees
Labels
status: declinedA suggestion or change that we don't feel we should currently applyA suggestion or change that we don't feel we should currently apply