How to organise common dependencies for Java 9 modules?

Viewed 116

For now I have maven project with several maven modules:

  • Root module, used as parent module for all other modules;
  • Some child modules, some of them depending on others.

For each module, except the root one, I've created module-info.java, where I've listed proper dependencies.

But I have some dependencies, required by any module. In maven, I've put them in dependencies section of the root pom.xml.

Is it possible to write them only once in root module's module-info.java, and then import it to submodules?

I know about command requires transitive ..., but I don't know how to make module-info, created in src/java directory of my root module, accessible by it's children's module-infos.

0 Answers
Related