It might be worth creating a base class for Plugins that takes care of this (now that we have several doing the same thing). That would allow us to hide the commonApplicationContext and BeanDefinitionAddingPostProcessor for common cases, instead exposing a simple addBeanDefinition method to sub-classes.