Where can I find OSGi bundles for Spring 4? I checked http://ebr.springsource.com/ but can only find Spring 3.2.x and the artifacts in Maven Central are not bundles.
Clarification
I'm not looking for Spring DM or similar. I'm looking for the "Spring Framework" JARs (spring-core, spring-beans, spring-context, …) as OSGi bundles. I'm not trying to create an application context in an OSGi environment. I just need the (exception) classes in an OSGi environment.
Build a service-oriented application using Spring and OSGi OSGi, also known as the Dynamic Module System for Java, specifies a modular approach to Java application development, as well as a set of standardized methods for managing dependencies between modules.
No, it doesn't support OSGi. Spring Boot is aimed to create microservices as packaged applications with every dependency and even the servlet containers packaged in an executable JAR, so it's highly modular and updateable, without the need to provide and configure an OSGi container.
The modular components of OSGi are known as OSGi bundles. Each OSGi bundle is a tightly coupled, dynamically loadable collection of classes, jars, and configuration files. Each OSGi bundle explicitly declares the packages they provide and the packages they require.
Spring will NOT support any further releases as OSGi bundles. The official support has been stopped with spring 3.2.4 (although you could find 3.2.5 artifacts here, contradicting the statement made in the Eclipse Forum)
Glyn Normington from Spring source acknowledged that in several places, see here:
However, there is hope. On the Karaf - dev list, one can read that they intend to support spring libraries in the ServiceMix project. Details in the entire thread see here.
I found ServiceMix had provided OSGi-fy Spring bundles up to ver. 4.1.4, http://repo2.maven.org/maven2/org/apache/servicemix/bundles/org.apache.servicemix.bundles.spring-aop/
I tried it in my osgi Bundle project, to set dependeny like that :
<dependency>
<groupId>org.apache.servicemix.bundles</groupId>
<artifactId>org.apache.servicemix.bundles.spring-core</artifactId>
<version>4.1.1.RELEASE_3</version>
</dependency>
Run in Felix a found sprint bundles are activated :
START LEVEL 1
ID|State |Level|Name
...
5|Resolved | 1|Apache ServiceMix :: Bundles :: spring-expression (4.1.1.RELEASE_3)
6|Active | 1|Apache Felix Gogo Command (0.14.0)
7|Active | 1|Apache Felix Gogo Runtime (0.12.1)
8|Active | 1|Apache Felix Gogo Shell (0.10.0)
...
10|Active | 1|Apache ServiceMix :: Bundles :: spring-context (4.1.1.RELEASE_3)
11|Active | 1|Apache ServiceMix :: Bundles :: spring-core (4.1.1.RELEASE_3)
....
But in it's latest release 5.4.0, ServiceMix only include spring 3.2.11.
Is there any risk when use spring 4.1.1 in my OSGi environment?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With