anchor.diff:  [[feature_variants]]
   = Feature variants and optional dependencies
   
  -Gradle supports the concept of _feature variants_:
  -When building a library, it's often the case that some features are only available when some dependencies are present, or when special artifacts are used.
  -
  -Feature variants will let consumers choose what _features_ they need, and the dependency management engine is going to select the right artifacts and dependencies based on those requirements.
  +Gradle supports the concept of _feature variants_: when building a library, it's often the case that some features should only available when some dependencies are present, or when special artifacts are used.
  +
  +Feature variants let consumers choose what _features_ of a library they need: the dependency management engine will select the right artifacts and dependencies.
   
   This allows a number of different scenarios (list is non exhaustive):
   
   - a (better) substitute to {maven-optional-deps}
  -- a _main_ library is built with support for different runtime features, and the user has to choose between one of them
  +- a _main_ library is built with support for different runtime features, and the <<sec::incompatible_variants,user has to choose between one of them>>
   - a _main_ library is built with support for different runtime features, each of them requiring a different set of dependencies
   - a _main_ library comes with secondary variants like _test fixtures_
   - a _main_ library comes with a main artifact, and enabling an additional feature requires additional artifacts
  
positive.code: include::sample[dir="java-feature-variant/producer/kotlin",files="build.gradle.kts[tags=variant_dependencies]"]
  ====
  
  By convention, Gradle will map the feature name to a capability which group is the same as the group and version as the main component, but a name composed of the main component name and the kebab-cased feature name.
  For example, here the group is `org.gradle.demo`, the name of the main component is `provider`, version is `1.0` and the feature is named `mongodbSupport`, so the feature variant will be `org.gradle.demo:provider-mongodb-support:1.0`.
  
  [[sec:feature_variant_source_set]]
  === Feature variant source set
  
negative.code: == Declaring feature variants
  
  Feature variants can be declared by applying the `java` or `java-library` plugins.
  The following code illustrates how to declare a feature named `mongodbSupport`:
  
  .Declaring a feature variant
  ====
  