Uploaded image for project: 'Gradle'
  1. Gradle
  2. GRADLE-3390

Module replacement not reflected in publication metadata

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Known Issue Of:

      Description

      Reported in forum: https://discuss.gradle.org/t/module-replacement-not-reflected-in-publication-metadata/14113

      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:

      repositories {
          jcenter()
      }
      
      dependencies {
          compile 'com.google.collections:google-collections:1.0'
          compile 'com.google.truth:truth:0.28' // Has a guava dependency
          modules {
              module("com.google.collections:google-collections") {
                  replacedBy("com.google.guava:guava")
              }
          }
      }
      
      publishing {
          repositories {
              ivy {
                  url 'build/testivyrepo'
                  name 'testivy'
              }
          }
          publications {
              ivyPublish(IvyPublication) {
                  from components.java
              }
          }
      }
      

      Results in:

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

      For:

      runtime - Runtime classpath for source set 'main'.
      +--- com.google.collections:google-collections:1.0 -> com.google.guava:guava:18.0
      \--- com.google.truth:truth:0.28
           +--- com.google.guava:guava:18.0
           \--- junit:junit:4.10
                \--- org.hamcrest:hamcrest-core:1.1
      

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            bmuschko Benjamin Muschko
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: