I'm trying to build a bundle that has an index (META-INF/INDEX.LIST
) using maven-bundle-plugin
2.3.7.
My plugin configuration looks like this
<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>
but META-INF/INDEX.LIST
will not show up in the JAR. I tried to use
<Include-Resource>{maven-resources},META-INF/INDEX.LIST</Include-Resource>
but that will fail with
[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
which is not surprising because META-INF/INDEX.LIST
is not in target/classes
but dynamically generated by the Maven Archiver.
Edit 1
When I use jar
instead of bundle
packaging then the index is there.
Edit 2
I'm using Maven 3.0.4
Dug around in the maven-bundle-plugin source code, and it looks like the current version (2.3.7) ignores the
index
attribute of the archive configuration. It also ignorescompress
,forced
, andpomPropertiesFile
. The only attributes of the archive configuration it does pay attention to areaddMavenDescriptor
,manifest
,manifestEntries
,manifestFile
, andmanifestSections
.I'm not sure if there is any other way to manipulate the created archive using only maven-bundle-plugin.
As a possible workaround, you might be able to use the maven-jar-plugin to re-jar the bundle after it's created, telling the jar plugin to create an index, but use the manifest created by the bundle plugin.
I'm not too familiar with what's required in a bundle archive, so you might want to double check that everything is correct.