With the new @AutoConfiguration
annotation, it would be nice to be able to configure relative ordering without having to use @AutoConfigureBefore
and @AutoConfigureAfter
. This could be achieved with attributes similar to the following:
/**
* The auto-configure classes that should have not yet been applied.
* @return the classes
*/
Class<?>[] before() default {};
/**
* The names of the auto-configure classes that should have not yet been applied.
* @return the class names
*/
String[] beforeNames() default {};
/**
* The auto-configure classes that should have already been applied.
* @return the classes
*/
Class<?>[] after() default {};
/**
* The names of the auto-configure classes that should have already been applied.
* @return the class names
*/
String[] afterNames() default {};
As a signal that relative ordering is preferred, support for absolute ordering will continue to only be supported with @AutoConfigureOrder
.
@philwebb wondered if we may be able to achieve the above using meta-annotations and @AliasFor
. To do that, we may need to make some changes so that @AutoConfigureBefore
and @AutoConfigureAfter
can be used as meta-annotations. Some experiments suggest that getAutoConfigurationMetadata
in AutoConfigurationSorterTests
doesn't. Some main code may need to change too, including the auto-configuration annotation processor.
Comment From: mhalbritter
Updated the release changelog.