I don't see anything like the answer to this on googlytubes, so here goes ...
We use several local plugins in our grails project. Recently, one of our plugins has a dependency on SLF4J. Our main webapp (which uses the plugin) also has a dependency on SLF4J. This leads to a completely harmless, but still annoying run-time warning:
Error SLF4J: Class path contains multiple SLF4J bindings.
Usually I simply define an “exclude” dependency on SLF4J plug-ins, but since this is a local plug-in, I see no way to do this. I tried...
grails.plugin.location.'localpluginname' = '../localplugindir' grails.project.dependency.resolution = { plugins { runtime("com.ourcompany:localpluginname:1.0") { excludes('slf4j-api') } } }
... but then it tries to actually resolve the mentioned plugin on remote repositories and fails. We also do not want to exclude the dependency directly in the plugin, because the plugin can be used in other projects that no longer provide dependency.
Before anyone suggests we deploy our local plugin for the local maven repository to do this, let me figure out that we don’t want to do this. We have them for some reason ... so we can quickly make changes and see the changes. We would rather live with annoying warning messages rather than increase the pain of deployment with each change.
James source share