Skip to content

Regression: custom composed @Profile annotation without runtime retention no longer supported with component scanning #23901

Closed
@pavelspicak

Description

@pavelspicak

Affects: Spring 5.2


If I create custom @Profile annotation such as this:

@Profile("sapConnector")
public @interface SapConnectorProfile {
}

and then annotate some bean with @SapConnectorProfile and set the property spring.profiles.active=demoConnector, the bean is still loaded.

If I use @Profile("sapConnector") directly on the bean, the bean is not loaded.

My original question on stack overflow: https://stackoverflow.com/questions/58554912/custom-spring-profile-annotation

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: declinedA suggestion or change that we don't feel we should currently applystatus: feedback-providedFeedback has been providedtype: regressionA bug that is also a regression

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions