Skip to content

Automatically detect and register static nested @FeatureConfiguration classes [SPR-8034] #12689

@spring-projects-issues

Description

@spring-projects-issues

Chris Beams opened SPR-8034 and commented

As a convenience to avoids the need to create a separate compilation unit (.java file) for @FeatureConfiguration types, allow users to do the following:

@Configuration
public class MyBeans {
    @Bean
    public DataSource dataSource() { ... }
    
    @FeatureConfiguration
    static class MyFeatures {
        @Feature
        public ComponentScanSpec scan() {
            return new ComponentScanSpec("com.bank.app");
        }
    }
}

In such a case, no explicit registration or import of the @FeatureConfiguration class would be necessary. Simply bootstrapping the container with

new AnnotationConfigApplicationContext(MyBeans.class);

Would be enough.


Issue Links:

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: invalidAn issue that we don't feel is valid

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions