For AI agents: the documentation index is at https://docs.gradle.org/llms.txt. Request any page with the header Accept: text/markdown to get Markdown. User manual pages are also available as Markdown by replacing .html with .md in the URL.

versionMapping

abstract fun versionMapping(configureAction: Action<in VersionMappingStrategy>)(source)

Configures the version mapping strategy. For example, to use resolved versions for runtime dependencies:

plugins {
    id 'java'
    id 'ivy-publish'
}

publishing {
  publications {
    maven(IvyPublication) {
      from components.java
      versionMapping {
        usage('java-runtime'){
          fromResolutionResult()
        }
      }
    }
  }
}

Since

5.4

Parameters

configureAction

the configuration