Is it possible for a .war project to be deployed into (Non-embedded) tomcat and for tomcat to apply java modules concepts on it?
I am thinking its NOT possible currently as of today for following reasons.
- it is actually catalina.jar which is getting launched by Java in catalina.bat or .sh and it will have to in turn load the modules. I could not see any such concept inside org.apache.catalina.loader.WebappLoader, WebappClassLoader or WebappClassLoaderBase in same package. I might be mistaken of course.
- I think we can create the .war project using module concepts. Have the modular restrictions enforced during code creation and compilation time if we have a module-info.java created. But all those extra checks will be not applied when application is running in tomcat. Those extra checks might of course keep the libraries inside WEB-INF/lib more efficiently organized during development.
I do realize we could easily leverage java modules when using embedded tomcat as long as you launch the code as a jar project with all needed dependencies and use --module-path.
R