# Gradle classifiers

**URL:** <https://discuss.gradle.org/t/gradle-classifiers/6091>\
**Category:** Old Forum Archive\
**Created:** [February 1, 2013, 1:39am UTC](https://discuss.gradle.org/t/gradle-classifiers/6091 "2013-02-01T01:39:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Josiah\_Haswell](https://avatars.discourse-cdn.com/v4/letter/j/258eb7/32.png) [@Josiah\_Haswell](https://discuss.gradle.org/u/Josiah_Haswell)\
**Post date:** [February 1, 2013, 1:39am UTC](https://discuss.gradle.org/t/gradle-classifiers/6091/1 "2013-02-01T01:39:00Z")

</div>

Hi folks,

I have the following configuration:

```gradle
//...
 configurations {
       tests
       published.extendsFrom tests, archives
   }
       dependencies {
       compile compileDependencies
       testCompile testDependencies
       clover 'com.cenqua.clover:clover:3.1.2'
   }
   task testArchive(type: Jar, dependsOn: testClasses) {
       classifier = "tests"
       from sourceSets.test.output
   }
   artifacts {
       archives testArchive
       tests testArchive
   }
     install {
       configuration = configurations.published
   }
}

```

for a project:

```gradle
group: com.mytest
 artifact: test-project
 version: 1.0.0-SNAPSHOT

```

Running “gradle clean install” generates the following artifacts in my repository:

```gradle
~/.m2/repository/com/mytest/test-project/1.0.0-SNAPSHOT/test-project-1.0.0-SNAPSHOT.jar
 ~/.m2/repository/com/mytest/test-project/1.0.0-SNAPSHOT/test-project-1.0.0-SNAPSHOT-tests.jar

```

which looks correct.

When I declare a dependency on those coordinates from another project as follows:

```gradle
testCompile group: "com.mytest", name: "test-project", version:"1.0.0-SNAPSHOT", classifier: "tests"

```

I get the following output:

```gradle
Could not resolve all dependencies for configuration ':otherproject'.
 Artifact 'com.mytest:test-project:1.0.0-SNAPSHOT:tests@jar' not found.

```

I notice that the Maven metadata for test-project doesn’t contain all of the same data that it does when the project is

built by Maven, but even builing and deploying test-project doesn’t make fix the problem. I’ve tried other formats like:

```gradle
testCompile "com.mytest:test-project:1.0.0-SNAPSHOT:tests"

```

to no avail. Am I missing something obvious?

I’m running Gradle 1.4 on JDK 1.7 on Mac OSX

Thanks!

Joe

---

<div class="post-metadata">

**Author:** ![luke\_daley](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/luke_daley/32/9890_2.png) [@luke\_daley](https://discuss.gradle.org/u/luke_daley)\
**Post date:** [February 1, 2013, 9:23am UTC](https://discuss.gradle.org/t/gradle-classifiers/6091/2 "2013-02-01T09:23:00Z")

</div>

Hi Joe,

Dependencies between projects are different in Gradle. The following previous post should help you out:

[http://forums.gradle.org/gradle/topics/how\_do\_i\_declare\_a\_dependency\_on\_a\_modules\_test\_code](http://forums.gradle.org/gradle/topics/how_do_i_declare_a_dependency_on_a_modules_test_code)

---

<div class="post-metadata">

**Author:** ![jordanblack10101](https://avatars.discourse-cdn.com/v4/letter/j/a9a28c/32.png) [@jordanblack10101](https://discuss.gradle.org/u/jordanblack10101)\
**Post date:** [April 17, 2014, 5:30pm UTC](https://discuss.gradle.org/t/gradle-classifiers/6091/3 "2014-04-17T17:30:00Z")

</div>

I’m having a similar issue.

testCompile group: ‘org.apache.sling’, name: ‘org.apache.sling.launchpad’, version:‘7-SNAPSHOT’, classifier:‘standalone’

gives this error:

Could not find org.apache.sling:org.apache.sling.launchpad:7-SNAPSHOT.

Required by:

com.snidigital.wcm.platform.test:wcm-platform-test-sling-example:1.0-SNAPSHOT

Although I have verified that the file ‘org.apache.sling.launchpad-7-SNAPSHOT-standalone.jar’ exists in my local m2 repository at directory \org\apache\sling\org.apache.sling.launchpad\7-SNAPSHOT.

---

<div class="post-metadata">

**Author:** ![Peter\_Niederwieser](https://avatars.discourse-cdn.com/v4/letter/p/9f8e36/32.png) [@Peter\_Niederwieser](https://discuss.gradle.org/u/Peter_Niederwieser)\
**Post date:** [April 17, 2014, 5:39pm UTC](https://discuss.gradle.org/t/gradle-classifiers/6091/4 "2014-04-17T17:39:00Z")

</div>

Make sure that you have a ‘mavenLocal()’ repository declared. If that doesn’t help, try with the latest Gradle version, as handling of Maven local has recently been improved. I don’t think your problem is caused by the classifier.

---

<div class="post-metadata">

**Author:** ![jordanblack10101](https://avatars.discourse-cdn.com/v4/letter/j/a9a28c/32.png) [@jordanblack10101](https://discuss.gradle.org/u/jordanblack10101)\
**Post date:** [April 17, 2014, 6:25pm UTC](https://discuss.gradle.org/t/gradle-classifiers/6091/5 "2014-04-17T18:25:00Z")

</div>

Yea, I had mavenLocal() declared in my repositories, but it wasn’t working. I had to actually include the file path to my local repo to get it to work. But yea, it wasn’t related to the classifier.
