gradle
8.4

# VersionMappingStrategy

interface VersionMappingStrategy(source)

The version mapping strategy for a publication. By default, Gradle will use the declared versions of a dependency directly. However in some situations it might be better to publish the resolved versions, or both when the metadata format supports it.

## Functions

allVariants
Link copied to clipboard
abstract fun allVariants(action: Action<out Any>)
Configures the version mapping strategy for all variants
usage
Link copied to clipboard
abstract fun usage(usage: String, action: Action<out Any>)
A short hand method to configure the variants which matches the provided Usage attribute.
variant
Link copied to clipboard
abstract fun <T> variant(attribute: Attribute<T>, attributeValue: T, action: Action<out Any>)
Configures the version mapping strategy for the variant which matches the provided attribute value.