Module replacement not reflected in publication metadata

We want to define project and enterprise-wide module replacements to avoid conflicts due to changed coordinates, however they’re not reflected in the published metadata. Reduced case is:

apply plugin: 'java'
apply plugin: 'ivy-publish'

group = 'test'
version = '1.0'

repositories {

dependencies {
    compile ''
    compile '' // Has a guava dependency
    modules {
        module("") {

publishing {
    repositories {
        ivy {
            url 'build/testivyrepo'
            name 'testivy'
    publications {
        ivyPublish(IvyPublication) {

Results in:

  <dependency org="" name="google-collections" rev="1.0" conf="runtime-&gt;default"/>
  <dependency org="" name="truth" rev="0.28" conf="runtime-&gt;default"/>


runtime - Runtime classpath for source set 'main'.
+--- ->
     \--- junit:junit:4.10
          \--- org.hamcrest:hamcrest-core:1.1

I can reproduce the issue with Gradle 2.10. I believe this is missing feature/bug for the module replacement functionality. Looking at the spec I couldn’t see a story that mentioned the integration with any of the publishing plugins. Briefly looking at the Gradle source code doesn’t reveal a test case that would verify the correct behavior.

I raised GRADLE-3390.

I guess that would mean this also applies to resolutionStrategy configurations too?

That is the case. I just verified it with the following code:

configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        if ( == '' && == 'google-collections') {
            details.useTarget group: '', name: 'guava', version: '18.0'

I found another discussion that references the same issue with resolutionStrategy.