Hello all

When creating a new project in NetBeans 18, one of the offered options is "Java with Ant > Java Modular Project". This is, to my knowledge, the only form of all NetBeans projects to offer Java Module Source Hierarchy support. The Module Source Hierarchy is a new way to organize source code introduced in Java 9 (the old way is called "Package Hierarchy") [1]. Not many developers are aware of this layout, maybe because neither Maven or Gradle support it yet. However the fact that NetBeans Ant supports this layout very well proves that it is possible in NetBeans.

I tried to explain what is Module Source Hierarchy, together with its implication for a Gradle project, in [2]. The Gradle team is considering to provide some support [3]. In the meantime, Gradle's flexibility makes possible to use Module Source Hierarchy anyway, but the result in NetBeans is currently not good (by comparison, it is okay in IntelliJ). I would like to improve that with patch contributions, but I have no knowledge of NetBeans internal. Can someone point me to which classes I need to look at please?

The first step would be to have NetBeans to properly shows JPMS module names. Currently it only shows "Source/Test Packages" with directory names for all modules (screenshot at [4]). What would be the classes to edit for controlling the tree shown in the "Project" tab for a Gradle project?

    Thanks,

        Martin

[1]https://docs.oracle.com/en/java/javase/20/docs/specs/man/javac.html#directory-hierarchies
[2]https://geomatys.github.io/draft/Modularization.html
[3]https://github.com/gradle/gradle/issues/25974
[4]https://geomatys.github.io/draft/sis_gradle_netbeans.png

Reply via email to