Reputation: 21924
I am drawing a blank on this for some reason. I have a multi-module Spring/Maven project. In module1 I define a singleton bean called "info" and it works within module1 just fine.
However module2 in this project (which depends on module1) has improvements on property values for the "info" bean. Module2's Spring configuration already includes Module1's configuration. What is the Spring configuration I should use to set properties on the "info" bean defined in this subsequent module?
Upvotes: 3
Views: 1709
Reputation: 49915
Create a new "info" bean in module2, configuring it the way specific to the needs of module 2. You would do something like this in your module 2 configuration:
<import resource="classpath:/META-INF/module1-config.xml"/>
<bean name="info" class="Module1class"/>
This should inject the right "info" into the dependent beans
Upvotes: 0
Reputation: 186
Since Spring 2.5 there is a PropertyOverrideConfigurer. Maybe that's what you are searching for
There is a small example on this page http://ondra.zizka.cz/stranky/programovani/java/howto-substitutions_in_spring_configuration-tutorial.texy
Upvotes: 1