Want to override a bean, supplied in jar
My application has just moved onto Maven, and now has multiples modules in it. My core modules has few beans defined along with JNDI DataSource bean.
One dependent module (depend on core module. dependency is through jar file built by maven) has few more beans defined. But for some reason, this module want to use his own Simple DataSource bean, instead of original bean, supplied inside the context files of jar. Of course, both bean should have same bean id, as the java class, which is intend to use this, is in jar file. Meaning it is the common code supplied by core module. And it is just that, instead of working with old database, it want want to work with new database. We are intended t use other bean from core modules as it is.
Please note that, this is not the case of property overriding, as one is jndi datasource and another is simple datasource. But of cource, we need the same bean id.
Treat me as a dumb user, but please come up with answer or alternative way.