Including 2 dependencies that would otherwise be evicted

I am curious if anyone has a work around for the ivy “all” conflict manager…

The main use-case is an upgrade from one library to another… jmock 1 to 2 or even Junit 3.X -> 4.X where BOTH jars can happily live on the classpath and allow for incremental migration of test cases

I have quite a bit of this in my codeline and have had a heck of a time working around it.

I tried to create and additional configuration

configurations.add(‘anotherTestCompile’)

But can’t seem to get it onto the java plugin testCompile classpath & testRuntime

There’s no real semantic way to express this right now, though there is some stuff in progress that will make this possible.

You’ll have to split this out into a new configuration…

configurations {
  oldLibs
}
  dependencies {
  oldLibs "junit:junit:3.9"
  testCompile "junit:junit:4.10"
}
  sourceSets {
  test {
    compileClasspath += oldLibs
  }
}

That we they are resolved separately, but all put on the classpath.

You may have to do some additional tuning to deal with transitives that are not compatible.