If this would not work, can we instead override the bean foo in an overlay, and then have the bean successfully injected into bar?
The ideal would still be two plugins, but if it is not possible, would the overlay alternative work?
From just the scenario, it sounds like what you proposed would work. You would have to extend both classes in your plugin/s and then override the spring definition of each class you extended. If possible, I would say keeping both extensions in one plugin would be best if the functions you're overriding are related to each other but it should still work regardless.