I want to set a profile name to a whole package and I don't know how. If where is no easy way then I have to mark every class in the package and sub packages with @Profile annotation.
<context:component-scan/> tag does not support attribute like profile so I have no idea.
If you don't mix XML and Java config you could use
@Profileon a bean which has@ComponentScanannotation with your target package maybe?Similarly with XML: you can have two different
<beans ...>sections, each with different profile and in each of the section you define your own<context:component-scan basePackage="..." />