【问题标题】:install osgi dependencies via maven bundle and sling plugins通过 maven bundle 和 sling 插件安装 osgi 依赖项
【发布时间】:2013-09-23 00:48:07
【问题描述】:

我有一个使用 maven-bundle-plugin 创建的 osgi-bundle:

<plugin>
  <groupId>org.apache.felix</groupId>
  <artifactId>maven-bundle-plugin</artifactId>
  <configuration>
    <instructions>
      <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
    </instructions>
  </configuration>
</plugin>

捆绑包是通过 maven-sling-plugin 安装的。

我有一个 fasterxml.jackson 依赖项,它作为 .m2 存储库中的 osgi-bundle 存在,并在我的项目中充当依赖项。

如何让 maven 将此依赖项也部署为 osgi-bundle?

目前我必须在我的 osgi-container 中手动安装它。

<dependency>
  <groupId>com.fasterxml.jackson.core</groupId>
  <artifactId>jackson-core</artifactId>
  <version>2.2.2</version>
</dependency>

编辑:

简化:

如何让 maven 意识到我在 pom.xml 中称为依赖项的 osgi-bundle 应与依赖它的 bundle 一起安装在 osgi-container 中?

【问题讨论】:

    标签: osgi sling maven-bundle-plugin


    【解决方案1】:

    您可能会发现最好将您的捆绑包与您的应用程序的/content/apps 部分一起打包到/apps/myapp/install 文件夹中,这将导致库作为捆绑包被安装jcr installer 提供者。

    这些文章中描述了几种使用 maven 自动打包/部署应用程序的方法:

    或者,您可以只使用 CRXDE 来放置捆绑包,然后使用 CRX 包管理器来测试该方法,然后它们会继续进行自动打包。

    如果不想重新打包这两个OSGI bundle,可以使用sling maven插件直接安装jackson bundle

    mvn org.apache.sling:maven-sling-plugin:install-file -Dsling.file=jackson-databind-2.2.2.jar
    

    【讨论】:

      猜你喜欢
      • 2012-04-20
      • 1970-01-01
      • 2018-09-20
      • 2014-07-29
      • 2012-07-13
      • 2013-01-12
      • 1970-01-01
      • 2014-09-14
      • 2013-05-12
      相关资源
      最近更新 更多