Defaultconfmapping has been broken since 1.5

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

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.

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?

Something like this shows how defaultconfmappings work in the IvyXmlModuleDescriptorParserTest:

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")))

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.