[GRADLE-1442] possible problem when single artifact is referenced in dependencies with different classifiers Created: 14/Mar/11  Updated: 08/Mar/16  Resolved: 02/Feb/12

Status: Resolved
Project: Gradle
Affects Version/s: 1.0-milestone-1
Fix Version/s: 1.0-milestone-8

Type: Bug
Reporter: Szczepan Faber Assignee: Unassigned
Resolution: Fixed Votes: 1

Attachments: Zip Archive classifierIssue.zip    
Issue Links:
Duplicated by GRADLE-1842 Resolution does not fail when depende... Resolved

project(':impl') {
    dependencies {
        compile     'foo.bar:util:1.0'
        //note the 'testutil' classifier
        testCompile 'foo.bar:util:1.0:testutil'
  1. given util-1.0-testutil.jar is not resolvable
  2. user runs gradle build
    • if there are tests classes referencing testutil the build will fail with compilation error
    • if there are not any tests referencing testutil the build will run OK

Expected result:

  • the build should fail with unsatisfied dependency?

I included a sample project that helps demonstrating the issue

Comment by Charlie Groves [ 08/Mar/16 ]

I'm still seeing this in Gradle 2.11. I have this build.gradle that depends on inject-core and its tests classifier from Twitter:

apply plugin: 'java'
repositories {

dependencies {
  compile 'com.twitter.inject:inject-core_2.11:2.1.4'
  compile 'com.twitter.inject:inject-core_2.11:2.1.4:tests'

With that setup, it only depends on the non-classified jar.

Generated at Wed Jun 30 11:55:37 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.