【发布时间】:2016-12-02 19:03:17
【问题描述】:
我正在为 OSGI 应用程序开发一个插件,使用 maven 进行编译。为了安装插件,OSGI 应用程序应该读取有关插件依赖项的信息。此信息应在 MANIFEST.MF 文件中提供。我想知道的是如何使用 Virgo Tooling 生成正确的 MANIFEST.MF 文件。
更新根据答案我使用了 Apache Felix
在我添加的 pom.xml 中
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<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>
<executions>
<execution>
<id>bundle-manifest</id>
<phase>process-classes</phase>
<goals>
<goal>manifest</goal>
</goals>
</execution>
</executions>
</plugin>
下载 maven-bundle.jar 并执行命令mvn org.apache.felix:maven-bundle-plugin:manifest 生成带有清单的 .jar 文件,但清单仅包含以下信息
Manifest-Version: 1.0
Implementation-Vendor: The Apache Software Foundation
Implementation-Title: Maven Bundle Plugin
Implementation-Version: 3.2.0
Implementation-Vendor-Id: org.apache.felix
Built-By: cziegeler
Build-Jdk: 1.7.0_80
Specification-Vendor: The Apache Software Foundation
Specification-Title: Maven Bundle Plugin
Created-By: Apache Maven 3.3.9
Specification-Version: 3.2.0
Archiver-Version: Plexus Archiver
任何想法我做错了什么?
【问题讨论】:
标签: java maven osgi eclipse-virgo