Advanced Configuration with Spring XML Files

The plugin framework provides the ability to create plugin components using complete Spring configuration files. If you provide Spring Dynamic Modules (Spring DM) configuration files in META-INF/spring/, these will be loaded into your plugin OSGi bundle by the Spring DM loader. Using this option for configuration provides you with a lot of flexibility about how your plugin components are created and managed.

<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns:beans="" 
        <beans:bean id="repositoryManager" class="com.atlassian.plugin.repository.logic.ConfluenceRepositoryManager"/>

To include a Spring configuration file, ensure it is included in the META-INF/spring/ directory inside your plugin JAR file. All files matching *.xml inside this directory will be loaded as Spring configuration files when your plugin is loaded. For more details on Spring configuration, see the Spring documentation.

Related topics

Converting from Version 1 to Version 2 (OSGi) Plugins
OSGi, Spring and the Plugin Framework
Writing Atlassian Plugins
Managing Plugin Dependencies

Was this page helpful?
Powered by Confluence and Scroll Viewport