Skip to content

In Spring Boot 2.4 @EntityScan does not support property substitution #25436

Closed
@tjuchniewicz

Description

@tjuchniewicz
@SpringBootApplication
@EntityScan("com.${test}")
public class EntityScanExampleApplication {

    public static void main(String[] args) {
        SpringApplication.run(EntityScanExampleApplication.class, args);
    }
}
test=value

For code above, in Spring Boot 2.4 entityscan.getPackageNames() returns com.${test}.
Worked in Spring Boot 2.3 and before.

Project to reproduce and check with 2.3: https://github.com/tjuchniewicz/spring-boot-entityscan-issue

Activity

wilkinsona

wilkinsona commented on Feb 25, 2021

@wilkinsona
Member

Thanks for the report. To my knowledge, we have never intentionally supported placeholders in @EntityScan. We certainly don't have a test for it anyway. The change in behaviour is due to the changes that we made for #22318. Moving away from reflection has meant that the constructor arguments no longer go through placeholder resolution.

Flagging for team attention to see if we want to reinstate the old behaviour and discuss how best to do that without regressing #22318.

wilkinsona

wilkinsona commented on Mar 4, 2021

@wilkinsona
Member

As @mbhave noted in #25415, @ComponentScan supports placeholders so we think it makes sense to reinstate @EntityScan's support for placeholders.

added
type: regressionA regression from a previous release
and removed
for: team-attentionAn issue we'd like other members of the team to review
on Mar 4, 2021
added this to the 2.4.x milestone on Mar 4, 2021
modified the milestones: 2.4.x, 2.4.4 on Mar 4, 2021
added a commit that references this issue on Mar 4, 2021
ca41473

19 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: regressionA regression from a previous release

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @wilkinsona@tjuchniewicz@spring-projects-issues

        Issue actions

          In Spring Boot 2.4 @EntityScan does not support property substitution · Issue #25436 · spring-projects/spring-boot