Skip to content

Document how to customize the basePackages that auto-configurations consider (for example Spring Data Repositories) #27549

@mdeinum

Description

@mdeinum

When adding an external library to Spring Boot with a different base package structure than your Spring Boot based application, a pattern emerges in the form of additional annotations to detect components, entities, repositories etc.

@SpringBootApplication(scanBasePackages= { "package1", "package2",...})
@EntityScan("package1", "package2",...})
@EnableJpaRepositories("package1", "package2", ...})
public class FooApplication { ... }

Or maybe even all packages added through an @ComponentScan to be included (unless explicitly specified that is).

This could be reduced if the scanBasePackages property was taken into account in places like the @EntityScan, auto- configuration of Spring Data Repositories etc.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions