api / org.gradle.api.artifacts.maven / Conf2ScopeMappingContainer / getMapping

getMapping

abstract fun getMapping(configurations: MutableCollection<Configuration>): Conf2ScopeMapping

Returns a scope that corresponds to the given configurations. Dependencies of different configurations can be equal. But only one of those equals dependencies (which might differ in content) can be mapped to a POM (due to the nature of a Maven POM).

Which scope is returned depends on the existing mappings. See #addMapping(int, Configuration, String). If only one configuration is mapped, this mapping is used to choose the scope. If more than one configuration of a dependency is mapped, and those mappings all map to the same scope, this scope is used. If more than one configuration is mapped and the mappings map to different scopes, the mapping with the highest priority is used. If there is more than one mapping with the highest priority and those mappings map to different scopes, an exception is thrown.

Parameters

configurations - The configuration

Return
The scope corresponding to the given configurations. Returns null if no such scope can be found.

See Also
#addMapping(int, Configuration, String)