【问题标题】:OSGi Bundle is missing a dependency despite Embed all dependencies with the maven bundle plugin尽管使用 maven bundle 插件嵌入所有依赖项,但 OSGi Bundle 缺少依赖项
【发布时间】:2018-09-20 06:07:34
【问题描述】:

我对 maven-bundle-plugin 使用以下设置:

<plugin>
    <groupId>org.apache.felix</groupId>
    <artifactId>maven-bundle-plugin</artifactId>
    <version>3.5.0</version>
    <extensions>true</extensions>
    <configuration>
        <instructions>
            <Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
            <Embed-Transitive>true</Embed-Transitive>
        </instructions>
    </configuration>
    <executions>
        <execution>
            <id>bundle-manifest</id>
            <phase>prepare-package</phase>
            <goals>
                <goal>manifest</goal>
            </goals>
        </execution>
    </executions>
</plugin>

然而,当我尝试启动捆绑包时,我的 Karaf 实例中出现“缺少要求”错误。

它缺少antlr.actions.csharp 依赖项,我有办法找出缺少哪个包/版本以及为什么缺少它吗?

编辑:问题似乎与 MANIFEST.MF 中列出的导入包有关 由于导入的包列出了引起问题的包。

【问题讨论】:

  • 您是否尝试过查看传递的 maven 依赖项?也许它是一个可选的依赖项。
  • @ChristianSchneider 我只能在依赖层次结构的已解决依赖关系中找到 antlr-2.7.2,它没有显示与任何其他 antlr 版本冲突,但是这个 antlr 版本没有缺少的包应卡拉夫的要求。我的项目使用 camel:run 以及 CamelBluePrintTestSupport 运行,只是不在 karaf 环境中。
  • 如果您将 maven bundle 插件保留为默认设置,您会得到哪些导入包语句? (见你的罐子清单)
  • 如果我将其保留为默认设置并且不嵌入依赖项,则导入包语句包含的包要少得多,主要是与骆驼相关的包。麻烦的包不在里面。
  • 这是一个更好的解决方案。嵌入很可能会导致问题。

标签: osgi apache-felix osgi-bundle karaf


【解决方案1】:

捆绑包的标题应该为您提供缺少的依赖项。在 karaf 实例中部署 Import-Package 时能否显示其输出?

【讨论】:

    猜你喜欢
    • 2021-12-25
    • 2021-11-23
    • 1970-01-01
    • 2012-04-20
    • 2013-09-23
    • 2012-07-13
    • 2012-04-07
    • 1970-01-01
    • 2013-01-12
    相关资源
    最近更新 更多