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

Incorrect handling of target-wildcard dependency in Ivy descriptor

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Fixed
    • Affects Version/s: 1.0
    • Fix Version/s: 1.5-rc-1

      Description

      There is a bug in the handling of ivy dependencies like "runtime->*".

      org.gradle.api.internal.artifacts.ivyservice.resolveengine.DependencyGraphBuilder has this code

                              if (targetConfiguration.equals("*")) {
                                  Collections.addAll(targetConfigurations, descriptor.getPublicConfigurationsNames());
                              } else {
                                  targetConfigurations.add(targetConfiguration);
                              }
      

      Consider a module X with configurations A and B, and a module Y with configuration Z, and X depends on Y with "A->*". In the above code, 'descriptor' is X's descriptor so descriptor.getPublicConfigurationsNames() will return [A,B] and it will be as if the dependency was declared as "A->A,B" which will fail to resolve. What the author probably intended was to add all of Y's configurations, just [Z], but that's not what happens here.

      To workaround for now, I have changed the above code to

      //                        if (targetConfiguration.equals("*")) {
      //                            Collections.addAll(targetConfigurations, descriptor.getPublicConfigurationsNames());
      //                        } else {
                                  targetConfigurations.add(targetConfiguration);
      //                        }
      

        Attachments

          Activity

            People

            • Assignee:
              daz Daz DeBoer
              Reporter:
              brianfromoregon Brian Harris
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: