loading table of contents...

Blueprint Developer Manual / Version 2310

Table Of Contents
Plugin Dependencies

Plugins can also have dependencies on other plugins to make use of their classes and beans. Dependencies are declared in the property plugin.dependencies. You can declare just the dependent plugin's ID or a specific version or version range separated by @. Multiple dependencies can be declared separated by commas.


  • some-plugin

  • some-plugin@1.0.0

  • some-plugin@>=1.0.0 & <2.0.0

Providing Beans to Dependents

The configuration classes described in Section, “Application Beans in Plugins” are a kind of public beans API for your plugin. For each of those configuration classes, you need to create a class implementing the BeansForPluginsContainer marker Interface. This implementation serves as a container for your Beans and is injected into the dependents application context.

For every Bean definition in the Configuration class there should be a field, a constructor argument and a getter in the BeansForPluginsContainer class. The configuration class should have a field and a constructor with one argument of the concrete BeansForPluginsContainer type, so it can delegate to this field in its Bean defining methods. This way Spring can resolve the bean dependencies for the BeansForPluginsContainer classes and dependents of your plugin get a simple IDE supported way to find and inject your beans.


PluginB depends on PluginA; PluginA provides a bean of type SomeBeanFromA to its dependencies and PluginB uses this bean.


Example 4.7. PluginA

// Used to collect beans to be injected into dependent plugins
public class PluginABeansForPluginsContainer implements BeansForPluginsContainer {
  private final SomeBeanFromA someBeanFromA;

  public PluginABeansForPluginsContainer(SomeBeanFromA someBeanFromA) {
    this.someBeanFromA = someBeanFromA;

  public SomeBeanFromA getSomeBeanFromA() {
    return someBeanFromA;

Example 4.8. PluginABeansForPluginsContainer

// Defines a public API of Beans to be used by dependents
// and provides convenient access to beans from PluginABeansForPluginsContainer.
@Configuration(proxyBeanMethods = false)
public class PluginABeansForPlugins {
  private final PluginABeansForPluginsContainer pluginABeansForPluginsContainer;

  public PluginBeansAConfiguration(PluginABeansForPluginsContainer pluginABeansForPluginsContainer) {
    this.pluginABeansForPluginsContainer = pluginABeansForPluginsContainer;

  public SomeBeanFromA someBeanFromA() {
    return pluginABeansForPluginsContainer.getSomeBeanFromA();

Example 4.9. PluginABeansForPlugins

  SomeBeanFromA someBeanFromA() {
    return new SomeBeanFromA();

  // Beans of type PluginBeans will be collected and injected into
  // dependents by the framework.
  PluginABeansForPluginsContainer pluginBeansA(SomeBeanFromA someBeanFromA) {
    return new PluginABeansForPluginsContainer(someBeanFromA);

Example 4.10. PluginAConfiguration


Example 4.11. PluginB

@Configuration(proxyBeanMethods = false)
class PluginBConfiguration {
  SomeBeanForB someBeanForB(SomeBeanFromA someBeanFromA) {
    return new SomeBeanForB(someBeanFromA);

Example 4.12. PluginBConfiguration

Search Results

Table Of Contents

Your Internet Explorer is no longer supported.

Please use Mozilla Firefox, Google Chrome, or Microsoft Edge.