Bug 64498 - Incorrect OSGi Manifests
Summary: Incorrect OSGi Manifests
Alias: None
Product: Tomcat 10
Classification: Unclassified
Component: Packaging (show other bugs)
Version: 10.0.0-M5
Hardware: All Mac OS X 10.1
: P2 normal (vote)
Target Milestone: ------
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2020-06-04 13:16 UTC by Volodymyr Siedlecki
Modified: 2020-06-09 12:42 UTC (History)
2 users (show)


Note You need to log in before you can comment on or make changes to this bug.
Description Volodymyr Siedlecki 2020-06-04 13:16:52 UTC

As I was incorporating the Tomcat EL bundles in Open Liberty, we noticed the manifests for Tomcat jars are slightly malformed/incorrect. 

- Bundle-Version should not use a dash: Bundle-Version: 10.0.0-M5
- Export-package is missing the package version

The manfiest indicates that these jars were build with Bnd:
Tool: Bnd-

Bnd would not have included the dash, so these may have been edited before being uploaded to maven? 




And this appears to be the case with others others as well.
Comment 1 Volodymyr Siedlecki 2020-06-04 13:18:42 UTC
This dash creates parsing issues:

java.lang.IllegalArgumentException: Invalid version in bundle org.apache.tomcat-el-api=: 10.0.0-M5
        at aQute.bnd.osgi.resource.ResourceBuilder.addManifest(ResourceBuilder.java:171)
        at aQute.bnd.osgi.resource.ResourceBuilder.addFile(ResourceBuilder.java:716)
        at aQute.bnd.repository.maven.provider.IndexFile.parseSingle(IndexFile.java:289)
        at aQute.bnd.repository.maven.provider.IndexFile.parseSingleOrMultiFile(IndexFile.java:272)
        at aQute.bnd.repository.maven.provider.IndexFile.lambda$update$3(IndexFile.java:230
Comment 2 BJ Hargrave 2020-06-04 14:34:30 UTC
We need to update the .bnd files to cleanup maven versions for the Bundle-Version headers. Something like:

Bundle-Version: ${cleanup_version;@VERSION@}

Ray Augé is looking into a PR to fix this.
Comment 3 rotty3000 2020-06-04 14:45:35 UTC
See https://github.com/apache/tomcat/pull/294
Comment 4 BJ Hargrave 2020-06-04 14:54:51 UTC
(In reply to BJ Hargrave from comment #2)
> Bundle-Version: ${cleanup_version;@VERSION@}

That should have been:

Bundle-Version: ${version_cleanup;@VERSION@}
Comment 5 Mark Thomas 2020-06-09 12:42:48 UTC
Fixed in:
- master for 10.0.0-M7 onwards
- 9.0.x for 9.0.37 onwards

Earlier versions aren't affected as they don't use BND.
9.0.x would only be affected if a qualifier was added to the version number.