Improve variant matching error messages Error messages prove to be difficult to interpret from a user point of view. This commit tries to improve the situation by doing a couple of things:
1. describing more clearly what the consumer is asking for. This includes, when possible (currently only in the Java ecosystem), interpreting the consumer attributes as a human-readable description, instead of a raw list of attributes. 2. giving more context when possible. In particular, sometimes we fail with an ambiguous variant error selection, but we only list the remaining candidates, not listing the ones which were actually discarded during selection. This proved to be particularly complex to debug from various users (plugin authors and end-users).
Set category attribute to 'library' for compile and runtime classpath Otherwise Gradle may attempt to match variants of other categories if the category=library variants to not fit (in which case Gradle should fail).