Proper propagation of flag when modifying metadata The `ConfigurationBoundExternalDependencyMetadata` was not properly propagating the `alwaysUseAttributeMatching` state when the metadata was modified. This caused legacy Maven / Ivy interop to kick in, as happened before Maven was fully moved to variant aware dependency management. One test needed to be modified, which in reality should have been changed at the 5.0 release.
Implement variant derivation strategy This commit changes how Maven metadata is derived into variants. Now we will only derive variants if the Java plugin is applied (the "base Java" plugin). This is implemented via a variant derivation strategy, and allows fixing the problem that a native component is unlikely to find sense in the derivation of Java variants. This fixes a bug where the native plugins wouldn't be able to consume native libraries published on Maven repositories, without Gradle metadata.