We discovered something unexpected today while we were working on a plugin for managing interactions in a Continuous Delivery pipeline. The plugin has a dependency to a client API which is published by a client-server implementation. Of course we want to continue to develop the entire solution using itself as a CD solution but we found that this was not possible because of what looks like an internal bug in Gradle.
It will of course be easiest to demonstrate this problem with a demo project but we don’t have time to do that right now, so I am writing this first in the hopes that this may ring some bells at your end. If after all it is a known bug I don’t need to document it further.
So, if I have a buildscript with dependencies to the plugin (but not its runtime dependencies declared) and it itself has a dependency on this client artifact, then if I go back to work on the client/server project, which also has the plugin active when I am running gradle I get the following error:
FAILURE: Build failed with an exception.
- What went wrong: Could not resolve all dependencies for configuration ‘:server:client:classpath’. > Module version group:wspgroup, module:wsp, version:1.4.4, configuration:default declares a dependency on configuration ‘default’
which is not declared in the module descriptor for group:servergroup, module:server, version:1.0.0
Now however, this project has no other reference to the module wsp other than in the buildscript.
Is this egg and chicken situation an unresolved problem in Gradle?
What is the best workaround? The only thing we can see now is swapping between a “development group” and a “release group” when we actually want to publish a new version of the client libraries - which isn’t very elegant at all…!