如何快速升级osgi / karaf中的spring bundle?

时间:2014-03-12 21:58:55

标签: spring apache-karaf

我安装了Spring 3.0.7附带的karaf(servicemix) 我需要使用Spring 3.1.0 我不想捆绑捆绑。 还有另一种方法吗?

由于

2 个答案:

答案 0 :(得分:0)

使用最新版本的Karaf,Spring有一项功能, 只需使用该新版本安装该功能。 Karaf / ServiceMix能够处理这个问题。

只做一个

feature:add-url <feature-maven-coordinate>
feature:install <desired-featue>

答案 1 :(得分:0)

Spring框架OSGI捆绑存储库已冻结,但在2014年9月1日之前仍可访问,版本仅限于3.2.4.RELEASE。

如果您想使用spring-framework 3.2.5或更高版本,则需要使用maven插件或其他插件转换包。 maven插件的一个示例如下所示:

            <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemalocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
         <modelversion>4.0.0</modelversion>

         <groupid>org.springframework</groupid>
         <artifactid>spring-core</artifactid>
         <version>${osgi.spring.version}</version>

         <dependencies>
          <dependency>
           <groupid>org.springframework</groupid>
           <artifactid>spring-core</artifactid>
           <version>${spring.version}</version>
          </dependency>
         </dependencies>


         <build>
          <plugins>
           <plugin>
            <groupid>org.apache.maven.plugins</groupid>
            <artifactid>maven-dependency-plugin</artifactid>
            <configuration>
             <includegroupids>org.springframework</includegroupids>
             <includeartifactids>spring-core</includeartifactids>
            </configuration>
           </plugin>
           <plugin>
            <groupid>org.apache.felix</groupid>
            <artifactid>maven-bundle-plugin</artifactid>
            <configuration>
             <instructions>
              <export-package>
               org.springframework.asm,
               org.springframework.asm.commons,
               org.springframework.asm.signature,
               org.springframework.asm.util,
               org.springframework.cglib,
               org.springframework.cglib.beans,
               org.springframework.cglib.core,
               org.springframework.cglib.proxy,
               org.springframework.cglib.reflect,
               org.springframework.cglib.transform,
               org.springframework.cglib.transform.impl,
               org.springframework.cglib.util,
               org.springframework.core,
               org.springframework.core.annotation,
               org.springframework.core.convert,
               org.springframework.core.convert.converter,
               org.springframework.core.convert.support,
               org.springframework.core.enums,
               org.springframework.core.env,
               org.springframework.core.io,
               org.springframework.core.io.support,
               org.springframework.core.serializer,
               org.springframework.core.serializer.support,
               org.springframework.core.style,
               org.springframework.core.task,
               org.springframework.core.task.support,
               org.springframework.core.type,
               org.springframework.core.type.classreading,
               org.springframework.core.type.filter,
               org.springframework.util,
               org.springframework.util.comparator,
               org.springframework.util.xml
              </export-package>
              <import-package>
               !org.springframework.asm.tree,
               !joptsimple,
               !sun.*,
               !org.apache.tools.*,
               !org.aspectj.*,
               *
              </import-package>
             </instructions>
            </configuration>
           </plugin>
          </plugins>
         </build>

        </project>