Configuration 'testRuntime' declares a dependency on configuration 'default' which is not declared in the module descriptor cobertura:2.0.3

(renjith4) #1


I was using the gradle-cobertura-plugin from to run the cobertura tests from gradle. However, recently I started hitting on the following errors

FAILURE: Build failed with an exception.
  What went wrong: Could not resolve all dependencies for configuration ':testRuntime'. > Module version misc:myproject:1.0-SNAPSHOT, configuration 'testRuntime' declares a dependency on configuration 'default' which is not declared in the module descriptor for net.sourceforge.cobertura:cobertura:2.0.3

and the configuration snippet is given below


buildscript {
      repositories {
    dependencies {
        classpath "net.saliman:gradle-cobertura-plugin:1.2.0"
  apply plugin: 'java'
apply plugin: 'cobertura'
  cobertura {
    cobertura.coverageIgnoreTrivial = true
    coverageFormats = ['xml', 'html']
    cobertura.coverageExcludes = ['.*DTO.*']
  dependencies {
    testCompile group: 'junit', name: 'junit', version: '4.11'
    testCompile 'com.h2database:h2:1.3.164'
    testCompile group: 'org', name: 'mockachino', version: '0.6.1', configuration: 'runtime'


project.ext {
    ivyArtifactPattern = '[organisation]/[module]/[module]-[revision]/[artifact]-[revision].[ext]'
    ivyPattern = '[organisation]/[module]/[module]-[revision]/ivy-[revision].xml'
  repositories {
    ivy {
        url ''
        layout "pattern", {
            artifact project.ivyArtifactPattern
            ivy project.ivyArtifactPattern

I am using gradle1.7. Can any one please advise on how to correct this?

Thanks in advance

(renjith4) #2

Any suggestions on what am I doing wrong in this configuration?

(renjith4) #3

It turns out that the issue could be fixed by modifying ivy.xml.

ivy.xml inside cobertura directory of ivy-cache was not having default configuration. it could be under a path like this


so added the default configuration and is working. phew. ivy.xml now looks like this

<ivy-module version="2.0">
  <info organisation="net.sourceforge.cobertura" module="cobertura" revision="2.0.3"/>
        <conf name="default" visibility="public" description="runtime dependencies can be used with this conf" extends="runtime"/>
        <conf name="runtime" description="Runtime dependencies (they are transitive)"/>
    <artifact name="cobertura" type="jar"
conf="runtime" ext="jar"/>
    <dependency org="asm" name="asm" rev="4.1" />
    <dependency org="log4j" name="log4j" rev="1.2.16" />

(Peter Niederwieser) #4

Patching the ivy.xml in the Gradle cache is not a stable solution. I’d rather contact the author of the plugin.

(renjith4) #5

True. That would be ideal. This was only a workaround till the issue is fixed. Here is the link for it to be tracked