Bug 66438 - Tomcat has broken module-info.class files
Summary: Tomcat has broken module-info.class files
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 10
Classification: Unclassified
Component: Packaging (show other bugs)
Version: unspecified
Hardware: PC Mac OS X 10.1
: P2 normal (vote)
Target Milestone: ------
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-22 22:21 UTC by Mike Hearn
Modified: 2023-01-23 19:55 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Hearn 2023-01-22 22:21:19 UTC
The module-info.class file in tomcat-embed-core-10.1.5.jar isn't valid and gets rejected by tools like jlink. Decompiling it with fernflower shows why:

open module org.apache.tomcat.embed.core {
    requires jakarta.annotation;
    requires jakarta.ejb-api;
    requires jakarta.mail;
    requires jakarta.persistence-api;
    requires jakarta.xml.rpc-api;
    ...
}

Oops. Those Jakarta module names aren't valid Java identifiers. You are apparently synthesizing a module-info.class file without using javac and it results in something that looks like it complies with JPMS but which doesn't.
Comment 1 Mark Thomas 2023-01-23 19:55:58 UTC
Thanks for the report.

Fixed in:
- 11.0.x for 11.0.0-M3 onwards
- 10.1.x for 10.1.6 onwards