Gradle netbeans modules

Just ran into a nasty bug in netbeans 12 when trying to convert a standard gradle project to be modular. I am using the application plugin to create the module and the library plugin, which allows you to use Java Modules with Legacy Libraries that have no manifest entry with the module name to allow it to become a proper automatic module.

This works by inferring the module name based off variables rather than using a module folder structure.

I decided to try and build a proper module first. The bug is that in order to create a module, as I understand it, you need to use this setup.


where the module name decalred in the file matches the folder name (my.module) and both live at the same level (src/main/java).

I figured no problem, create the folder my.module and refactor move the package into that folder.

This causes an exception and after the refactor you will find that all files to be moved were deleted instead.

Thankfully for me, this is a git project so just undoing changes fixes things and Im back in business.

Just a heads up.

Not sure if a regular ant project would be affected, as that is what netbeans uses by default when creating a module.