anchor.diff:  include::sample[dir="java-feature-variant/producer/kotlin",files="build.gradle.kts[tags=register_variant]"]
   ====
   
  -This will automatically setup a number of things for you, in a very similar way to what the <<java_library_plugin.adoc,_Java Library Plugin>> defines configurations:
  +Gradle will automatically setup a number of things for you, in a very similar way to how the <<java_library_plugin#java_library_plugin,Java Library Plugin>> sets up configurations:
   
   - the configuration `mongodbSupportApi`, used to _declare API dependencies_ for this feature
   - the configuration `mongodbSupportImplementation`, used to _declare implementation dependencies_ for this feature
  
positive.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
  ====
  
negative.code: include::sample[dir="java-feature-variant/producer/kotlin",files="build.gradle.kts[tags=variant_dependencies]"]
  ====
  
  [NOTE]
  ====
  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, if the group is `org.gradle.demo`, the name of the component is `provider`, its version is `1.0` and the feature is named `mongodbSupport`, so the feature variant will be `org.gradle.demo:provider-mongodb-support:1.0`.
  
  If you choose the capability name yourself or add more capabilities to a variant, it is recommended to follow the same convention.
  ====
  
  [[sec:feature_variant_source_set]]
  === Feature variant source set
  