Change spring bean alias with System property
I try to figure out whether it's possible to change a spring alias configuration through a system property. That's the configuration: <beans> <bean id="beanOne" ... /> <bean id="beanTwo" ... /> <bean id="beanThree" ... /> <alias name="beanOne" alias="beanToUse" /> <bean id="consumer" ...> <constructor-arg ref="beanToUse" /> </bean> </beans> I'd like to be able to use a JVM property e.g. with -Duse=beanThree to select another bean for the alias. Unfortunately using the straight forward solution <alias name="#{systemProperties.use}" alias="beanToUse" /> throws a NoSuchBeanDefinitionException