M6 doesn't tolerate jars with incorrect pom.xml in which the package type is incorrectly set to pom

We’ve discovered since upgrading to M6 (from M3) that some of our 3rd party jars have foobar’ed poms, in which the packaging type is set to “pom” instead of “jar”.

In M3, gradle tolerated this. Pulled in the jar and its dependencies as expected.

In M6, gradle will pull in the dependencies, but ignore the jar artifact itself. Technically, M6 is probably doing the right thing, but it does make it less convenient to work with the less than perfect pom.xmls out in the world.

Here’s a working example:

configurations {
    foo
}
  repositories {
    mavenRepo urls: 'http://172.16.15.202/artifactory/libs-development'
}
  dependencies {
    foo group: 'org.jboss.security', name: 'jbosssx', version: '2.0.3.SP1'
}
  task foos << {
    configurations.foo.files.each {
        println it.name
    }
}
  task wrapper(type: Wrapper) {
    gradleVersion = '1.0-milestone-3'
}

The workaround is to specify a dependency on both the module and the specific artifact:

dependencies {
    compile ['org.jboss.security:jbosssx:2.0.3.SP1@jar', 'org.jboss.security:jbosssx:2.0.3.SP1']
}

This is GRADLE-1975, which has been fixed in master. The fix will be available in Gradle 1.0-milestone-7. A snapshot should be available soon.

This has been fixed in the source, and will be working in milestone-7.