Problem occurs when some of the jar.manifest.attributes contains non-plain-String or null value.
I came across two use cases
(1). It's rather easy to put a GString into jar.manifest.attributes without having intention to do so (and i suspect this is rather common issue)
jar {
manifest {
attributes ('My-Attribute': "${project.name}/${project.version}")
}
}
(2). 'org.dm.bundle' plugin does not coexist with native Gradle's 'osgi' plugin - i guess it shouldn't, but I recommend throwing explicit exception to not mislead users like with NPE exception in Bnd. Root cause - native 'osgi' plugin adds property 'Bnd-LastModified' which is stored as Long, not as `String' - that causes NPE in Bnd tools
I recommend fixing this problems:
In BundleUtils.groovy - static def attributes(Manifest manifest) - check for the type of values when merging them into output
check for presence of 'osgi' plugins in the set of applied plugins during startup of the 'org.dm.bundle' plugin
I've got this (https://github.com/bndtools/bnd/issues/1270) problem while playing with that plugin.
Problem occurs when some of the jar.manifest.attributes contains non-plain-String or null value. I came across two use cases
(1). It's rather easy to put a GString into jar.manifest.attributes without having intention to do so (and i suspect this is rather common issue)
(2). 'org.dm.bundle' plugin does not coexist with native Gradle's 'osgi' plugin - i guess it shouldn't, but I recommend throwing explicit exception to not mislead users like with NPE exception in Bnd. Root cause - native 'osgi' plugin adds property 'Bnd-LastModified' which is stored as
Long
, not as `String' - that causes NPE in Bnd toolsI recommend fixing this problems: