I have a number of domain classes that I've moved into a plugin as a Multi-Project Build. For some reason, they're no longer accepting Map constructors. For instance, before I could call:
def instance = new UserRole(user: user, role: role)
But after I moved the domain classes into a plugin, I get the following error:
Error on startup: Could not find matching constructor for: com.testcompany.UserRole(java.util.LinkedHashMap)
Is there something I need to do to re-enable domain classes to automatically accept named parameters in the plugin?
I'm using Grails 3.2.3.
The map constructors are added by grails-plugin-controllers
as they weave the data binding logic into the constructors so you would need to add that dependency to the plugin, but only if you plan to use the domain classes exclusively in a web environment.
Otherwise you can always use bindData(instance, [user: user, role: role])