Add support for honouring Maven excludes

Maven exclusions have subtly different semantics to those in Gradle.
In Maven if dependency ‘a’ excludes ‘b’, then any dependency on ‘a’
(direct or transitive) will not pull in ‘b’. In Gradle that’s not the
case and to avoid ‘a’ pulling in ‘b’, any transitive dependency on ‘a’
also has to exclude ‘b’. Gradle’s solution to this is to recommend the
use of configuration-wide exclusions, rather than declaring exclusions
on individual dependencies. However, this falls down as Maven doesn’t
have the concept of a configuration. This means that a library that
publishes a Maven pom with exclusions that are correct when used with
Maven will have unwanted dependencies when used with Gradle. Given that
Gradle is using the Maven metadata to resolve the artifact and its
dependencies, it’s unfortunate that it does not honour Maven’s exclusion
semantics.

This commit adds support for honouring exclusions that are declared in a
Maven pom. Both the exclusions declared in imported boms and exclusions
declared in the poms of any dependencies are honoured. If a dependency
does not have a pom then it is silently ignored. Gradle doesn’t provide
an API that grants a plugin easy access to a dependency’s metadata. This
makes accessing the exclusions for a dependency rather tricky. The
approach taken in this commit is to create a copy of a configuration
just before the configuration is resolved. This copy is resolved to
gain access to the complete dependency graph. The plugin walks this
graph to collect information about the configuration’s dependency and
their exclusion metadata. This information is then used to determine
what should and should not be excluded when the real configuration is
resolved. Appropriate exclusion rules are applied to the real
configuration and it’s then resolved as normal.

Closes #2