Reputation: 1
When using spring, I want to have a configuration structure like:
//package com.test
//main configuration A
@Configuration
@ComponentScan({"com.pakcage.A", "com.common"})
public class AppA{
...
}
//package com.test
//main configuration B
@Configuration
@ComponentScan({"com.pakcage.B", "com.common"})
public class AppB{
...
}
//package com.common
//sub configuration for common use
@Configuration
@ComponentScan({"com.pakcage.common1", "com.package.common2"})
public class CommonConfig{
...
}
I can launch my Application by useing Configuration AppA or Configuration AppB, and all of them contains some common packages to scan like
"com.pakcage.common1"/"com.package.common2"
, I want to put it into a single configuration.
I want to ask
@ComponentScan
, there will be a combination of all of these @ComponenScan
?Upvotes: 0
Views: 79
Reputation:
@ComponentScan
will be scanned.Upvotes: 2