简体   繁体   中英

Should I use Java modularity into my existing Maven multi module web project when migrating to Java9+?

I have an existing Multi modules maven project (in Java 8), one of thoses modules is a webapp which produce a war file deployed into Tomcat 9 .

I planned to migrate to Java 11 . I am wondering if there is a benefit of adding java modularity to my project (ie creating a module-info.java for each maven modules) ?

Is there any benefit of adding Java Modularity when producing a war file (maven will already add all its dependencies in WEB-INF/lib) ?

At final, I suppose Tomcat is not using Java modularity when deploying the war ? So, I can't see any benefit of using Java modularity in a web environment , maybe I am missing something ?

I guess it depends on whether or not you are experiencing problems that modulization was intended to fix. I work in a Spring microservices team. We did not start using modules when we migrated to Java 10 from 8. Mainly because we were not encountering the problems that modules was intended to fix... like conflicting library dependencies, or large packages. So no need for the extra complexity.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM