I have a custom module which is really just a Java module that has a predefined project structure, an initial class, and some initial libraries. I can add libraries to the module programatically (mostly) fine, but when I go to the Module Settings -> Library and add a library to the module it does not get added.
My CustomModuleBuilder only overrides
setupRootModel (and it calls the JavaModuleBuilder.setupRootModel at the end)
A few interesting things I noticed as well that might be contributing
1) Under Module Settings -> Modules my custom modules gives a blank screen, as opposed to the Java modules which give Sources/Paths/Dependencies.
In my CustomModule.java I tied overriding the createWizardSteps/modify and returing StdModuleTypes.Java methods, but it did not change anything.
2) In the module.iml it does not show the added libraries
3) If I go to Module Settings -> Libraries and try and remove the module it warns me that my custom module is using the library.
4) If I call ModuleRootManager.getInstance(source).orderEntries().forEachLibrary it does not find the libraries I attempted to add.
Is there usually an obvious cause for this? What paths are taken when adding a library via the GUI? I'm kind of at a loss where to investigate next.