Last updated Mar 27, 2024

In order to use Spring Java configuration in your P2 app, you will need to add the following Maven dependencies:

1
2
<dependency>
    <groupId>org.osgi</groupId>
    <artifactId>osgi.core</artifactId>
    <version>6.0.0</version>
    <scope>provided</scope>
</dependency>
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-beans</artifactId>
    <version>5.0.10.RELEASE</version>
    <scope>provided</scope>
</dependency>
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-context</artifactId>
    <version>5.0.10.RELEASE</version>
    <scope>provided</scope>
</dependency>

N.B. you may wish to manage these version numbers elsewhere and/or use a POM property for the Spring version number, to avoid duplication.

If you want to use the Atlassian helper library that makes it easy to import and export OSGi services, also add this dependency:

1
2
<dependency>
    <groupId>com.atlassian.plugins</groupId>
    <artifactId>atlassian-plugins-osgi-javaconfig</artifactId>
    <version>0.6.0</version>
</dependency>

You can find out the latest version of this library by pointing your browser to the Atlassian Maven repository.

Rate this page: