Question Details

No question body available.

Tags

spring-boot gradle spring-security

Answers (1)

Accepted Answer Available
Accepted Answer
December 9, 2025 Score: 0 Rep: 2,136 Quality: Medium Completeness: 50%

I think this is a component scanning problem. By default Spring scans the package and sub-packages where main class or @SpringBootApplication exists.

For example:

com.example.app1.App1Application ← scans com.example.app1.controller ← scans com.example.security.SecurityConfig ← Not scns

You should dictate the main class in app1

@SpringBootApplication @ComponentScan(basePackages = { "com.example.app1", "com.example.security" })