I just recently started using Java modules.  From what I’ve read, standard 
layout for projects with modules is:
src/
  main/
    java/
      com.example.module_a/
        module-info.java
        com/
          example/
            a/
              ExampleA.java
      com.example.module_b/
        module-info.java
        com/
          example/
            b/
              ExampleB.java

However, even though my Gradle-based project builds fine, NetBeans highlights 
my package delclarations claiming that the package name is wrong.  It appears 
to be confused about the root folder for the module.  It thinks the module name 
should be repeated in the package name, or the .java files should be moved to a 
folder without the module name folder as the root.

E.g. based on the above layout, ExampleA.java has:

package com.example.a;

but NB wants it to be:

package com.example.module_a.com.example.a;

or relocated to:

src/main/java/com/example/a/ExampleA.java

without the module name subfolder.

Does NetBeans support modules when there is more than one in the project?  I 
can make it stop complaining if I only have one module and I remove the module 
name folder so the module root is not in a subfolder of src/main/java/ 

I couldn’t find anything in Jira related to this.  Is it not supported yet, or 
am I doing something wrong?

Regards,

Scott

Reply via email to