- 
                Notifications
    You must be signed in to change notification settings 
- Fork 38.8k
Closed
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: regressionA bug that is also a regressionA bug that is also a regression
Milestone
Description
Spring Boot version: 3.4.1
Spring Core version: 6.2.1
I am getting FileNotFoundException: JAR entry my/app/config/ not found in my-app.jar!/BOOT-INF/lib/dependency.jar
when using @ComponentScan and @ConfigurationPropertiesScan annotations and having a dependency.jar that contains common parent package that matches ConfigurationPropertiesScan.basePackages value.
This exception is thrown when PathMatchingResourcePatternResolver takes resources from rootDirCache that match common parent directory, updates the resource path and tries to access a directory that does not exist in that jar file.
I have a dependency.jar in my application that contains my.app package and the Application class configured like below.
@SpringBootApplication
@ConfigurationPropertiesScan("my.app.config")
@ComponentScan(basePackages = ["my.app"])
class Application
fun main(args: Array<String>) {
    @Suppress("SpreadOperator")
    runApplication<Application>(*args)
}In this case,
- An entry with my.appas key anddependency.jar!/my/appas value is added torootDirCachewhile processing the @componentscan annotation
- The same entry is read while processing ConfigurationPropertiesScan annotation as patent package matches
- The File not found exception is thrown when it tries to access dependency.jar!/my/app/configwhich does not present in that jar file.
Metadata
Metadata
Assignees
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: regressionA bug that is also a regressionA bug that is also a regression