Dependencies 如何让maven bundle插件在OSGi清单中包含maven依赖项<;进口包装>;
希望有人能帮我解决这个问题。我试图使用maven捆绑插件从maven依赖项自动生成OSGi清单。我正在OSGi容器中安装一些依赖项,因为它们是跨多个捆绑包共享的。例如,春天。我正在设置这些依赖项的范围(因为它们是在容器中提供的,而不是嵌入的)。但是,我无法让maven bundle插件在清单的部分中包含这些依赖项。有什么办法吗Dependencies 如何让maven bundle插件在OSGi清单中包含maven依赖项<;进口包装>;,dependencies,osgi,maven-bundle-plugin,Dependencies,Osgi,Maven Bundle Plugin,希望有人能帮我解决这个问题。我试图使用maven捆绑插件从maven依赖项自动生成OSGi清单。我正在OSGi容器中安装一些依赖项,因为它们是跨多个捆绑包共享的。例如,春天。我正在设置这些依赖项的范围(因为它们是在容器中提供的,而不是嵌入的)。但是,我无法让maven bundle插件在清单的部分中包含这些依赖项。有什么办法吗 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/20
<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>com.example.osgi.test</groupId>
<artifactId>spring-mvc-bundle</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<properties>
<spring.version>3.0.5.RELEASE</spring.version>
<spring.osgi.version>1.2.1</spring.osgi.version>
</properties>
<!-- Module dependencies -->
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
<scope>provided</scope>
</dependency>
<!-- Other dependencies here... -->
</dependencies>
<!-- Build plugins + config -->
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<id>create-war</id>
<phase>package</phase>
<goals>
<goal>war</goal>
</goals>
</execution>
</executions>
<configuration>
<archive>
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.3.5</version>
<executions>
<execution>
<id>bundle-manifest</id>
<phase>process-classes</phase>
<goals>
<goal>manifest</goal>
</goals>
</execution>
</executions>
<extensions>true</extensions>
<configuration>
<supportedProjectTypes>
<supportedProjectType>war</supportedProjectType>
<supportedProjectType>jar</supportedProjectType>
<supportedProjectType>bundle</supportedProjectType>
</supportedProjectTypes>
</configuration>
</plugin>
</plugins>
</build>
4.0.0
com.example.osgi.test
springmvc包
0.0.1-快照
战争
3.0.5.1发布
1.2.1
org.springframework
spring上下文
${spring.version}
假如
org.apache.maven.plugins
maven战争插件
2.2
制造战争
包裹
战争
${project.build.outputDirectory}/META-INF/MANIFEST.MF
org.apache.felix
maven捆绑插件
2.3.5
捆绑清单
进程类
显示
符合事实的
战争
罐子
捆
这在很大程度上取决于您对这些依赖项的使用。如果它们与动态类加载一起使用,bnd工具就不知道如何处理它们。因此,您需要将这些依赖项添加到配置部分的某个部分。这样,除了已找到的导入之外,这些将作为导入添加到清单中。这在很大程度上取决于您对这些依赖项的使用情况。如果它们与动态类加载一起使用,bnd工具就不知道如何处理它们。因此,您需要将这些依赖项添加到配置部分的某个部分。通过这种方式,除了已找到的导入之外,这些内容将作为导入添加到您的清单中。您不是使用标准archiver而不是bundle插件进行归档吗?您是否按照捆绑插件页面上的说明进行了操作?您不是使用标准archiver而不是捆绑插件进行归档吗?您是否按照bundle插件页面上的说明进行了操作?