I'm building my first modular app with Java 11 and Maven 3.6.1. My IDE is IntellijIDEA 2019.1.3. I added a module 'app' and added module-info.java
, but I'm confused because my app is working even I added spring dependencies to the app module and I didn't open my module or some package in the module for reflection.
I added module-info.java
with my IDE's feature and it forces me to add requires
statements. So far so good. But why it works without opening the module for reflection? Is that some new feature in Java 11 or in my IDE version? Am I doing something wrong?
My module-info.java
:
module app {
requires spring.web;
requires spring.webmvc;
requires javax.servlet.api;
requires spring.context;
}
I tried to find the answer on SO and JetBrains, but I failed.
And one more question: How can I examine the module-path with my IDE? How can I see which modules are there and what is on my classpath (right now there should be nothing)?
Aucun commentaire:
Enregistrer un commentaire