so after some research, viewing, and finally a query on the Grails mailing list (see the mailing list archives at: http://grails.1312388.n4.nabble.com/Grails-user-f1312389.html I found a solution.
My goal was to create a global ASTTransformation to add an org.slf4j.Logger object instead of the usual org.apache.commons.logging.Log object in each Artefact class without annotation.
So here are the steps:
I created a Java class similar to https://github.com/grails/grails-core/blob/master/grails-logging/src/main/groovy/org/codehaus/groovy/grails/compiler/logging/LoggingTransformer. java , but with my own implementation of the org.slf4j.Logger object. It is imperative to place Java.class in the following package: org.codehaus.groovy.grails.compiler as
Grails scans classes annotated with @AstTransformer in this package. (Graham Rocher)
and pack it in the JAR along with the MANIFEST.MF file in the META-INF/ folder. A META-INF/services catalog with all its materials is not needed, as Graham Rocher said:
You do not need META-INF / services material, and I would delete it, as this probably complicates matters.
So, I think this statement was more related to my specific problem, since I have only one @AstTransformer class in my plugin, but this is just an assumption. And I did not look for additional information on this topic. Maybe some other developer who needs this can do some research and share their decision on this topic ...
The JAR must be imported into the plugin and placed in the lib/ directory. After that you can make grails clean , grails compile and grails package-plugin .
If you want to replace the log implementation, just like me, you must exclude the grails-logging and grails-plugin-log4j JAR files from the specified project class path. This is done in the BuildConfig.groovy file:
inherits("global") { excludes "grails-plugin-log4j", "grails-logging" }
Now install the grails install-plugin \path\to\plugin.zip and everything should work as expected.
Hope this helps ...