【发布时间】:2012-10-21 08:25:53
【问题描述】:
我正在尝试使用 maven-bundle-plugin 2.3.7 构建具有索引 (META-INF/INDEX.LIST) 的包。
我的插件配置是这样的
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<archive>
<index>true</index>
</archive>
<instructions>
<!-- other things like Import-Package -->
<Include-Resource>{maven-resources}</Include-Resource>
</instructions>
</configuration>
</plugin>
但META-INF/INDEX.LIST 不会出现在 JAR 中。我尝试使用
<Include-Resource>{maven-resources},META-INF/INDEX.LIST</Include-Resource>
但这会失败
[ERROR] Bundle com.acme:project::bundle:1.0.0-SNAPSHOT : Input file does not exist: META-INF/INDEX.LIST
[ERROR] Error(s) found in bundle configuration
这并不奇怪,因为META-INF/INDEX.LIST 不在target/classes 中,而是由 Maven Archiver 动态生成的。
编辑 1
当我使用 jar 而不是 bundle 包装时,索引就在那里。
编辑 2
我正在使用 Maven 3.0.4
【问题讨论】:
-
没有
target/maven-archiver文件夹,只有target/classes、target/test-classes、target/generated-sources、target/generated-test-sources和target/surefire-reports。 -
我正在使用 maven 3.0.4 和命令“mvn org.apache.felix:maven-bundle-plugin:bundle”,它确实在目标中显示了一个 maven-archiver。但即使我无法生成 INDEX.LIST 文件。如果我得到解决方案,将在此处更新。
-
为什么不使用 mvn clean package ?
-
我正在使用
mvn clean package,但生成的 jar 没有索引。
标签: java maven bnd maven-bundle-plugin