Defaultconfmapping has been broken since 1.5


(Justin Ryan) #1

In 1.5, it appears that Daz refactored IvyXmlModuleDescriptorParser.java. And in the process he renamed a variable, but didn’t change all usages of it. On this location:

https://github.com/gradle/gradle/commit/637f0e1e94023600a7ee083de3c736d5e1400d9d#L0R681

defaultConf is being checked for null, but it’s suppose to be checking defaultConfMapping. Since it’s checking the wrong variable, the defaultConfMapping is never set. From what I can tell, there are zero tests for defaultConfMapping, which is why this was missed.

Since this mistake seems clear and breaks Ivy, I request that the fix go into 1.6 before it’s released. defaultConfMapping is incredibly important to an Ivy repository. Especially since new versions of Gradle’s publish plugin put dependencies into the runtime conf, and modules typically put their depenedencies in the compile conf. Without a conf mapping, the compile dependencies will go the compile config of the other module, which because recent publish plugin won’t have any artifacts or dependencies.


(Luke Daley) #2

Almost certain that we’ll halt 1.6 to fix this. What do we need to do to exercise this so I can add a functional test case?


(Justin Ryan) #3

Something like this shows how defaultconfmappings work in the IvyXmlModuleDescriptorParserTest:

https://github.com/quidryan/gradle/commit/5e54668f38ab38239eec978a8eabfe976168f56f

Adding the mapping though might has expose other issues. Another part of the test fails and I’m not sure which is wrong, the test or the code:

assertEquals(["*"], Arrays.asList(dd.getDependencyConfigurations("myconf1")))

(Luke Daley) #4

This didn’t make it into 1.6 I’m afraid. We weren’t able to delay 1.6 as we had deadlines we had to meet.

I’ve raised this as GRADLE-2766 and it will be fixed in the 1.7 nightlies soon.