I declared several @Components in src/groovy/my/package of a grails 3.1.10 plugin and added the package name to the component scan by adding the following in grails-app/init/application.groovy:
@Override
Collection<String> packageNames() {
super.packageNames() + ['package.from.plugin']
}
It works well as long as I am running the plugin itself. When I include my plugin by adding it in the build.gradle of my application:
compile project(':my-plugin')
and run the application, the beans declared in my-plugin do not get wired properly anymore, they cannot be found.
What is the proper way to add custom Components/Beans from Grails Plugin to Grails application component scan?