With following yml
app:
a:
prop: aaa
b:
prop: bbb
@Component
public abstract class Common {
@Value("${prop}")
private String prop;
@ConfigurationProperties(prefix = "app.a")
@PropertySource("classpath:app.yml")
@Component
public static class A extends Common {
}
@ConfigurationProperties(prefix = "app.b")
@PropertySource("classpath:app.yml")
@Component
public static class B extends Common {
}
}
But those two classes has same value, either for a
or b
.
How can I solve this?