2018.3 - Should it set up dependency automatically based on Maven configuration ?

Answered

Hi,

       I have a Maven multi-module JDK 11 project. A parent POM references child POM's. When I add a dependency to a child module's( JPMS  ) POM I don't see the dependency automatically set up in the IDE for compilation. Should it do that ? I had to add this manually as depenedency.

<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr4-runtime</artifactId>
<version>4.7</version>
</dependency>

I believe it setup JavaFX dependencies when I had a module-info.java file like this and dependencies in the POM. Are both of these required to cause t he IDE to setup dependencies ?

 

module layout {
requires decorator;
requires javafx.controls;
requires javafx.fxml;
exports com.layout;
}

Which one of the above will cause the IDE to setup dependencies automatically ?

Thanks,

Mohan

1 comment

>When I add a dependency to a child module's( JPMS  ) POM I don't see the dependency automatically set up in the IDE for compilation. Should it do that ?

You need to re-import project from Maven in Maven tool window after changing pom.xml files. Or enable Auto-import option. Then IDE will add the declared in pom.xml dependency for the IDE project.

> believe it setup JavaFX dependencies when I had a module-info.java file like this and dependencies in the POM. Are both of these required to cause t he IDE to setup dependencies ?

The both is required for Maven to build the project (this is not IDE requirement).

0

Please sign in to leave a comment.