Hi folks,
I have the following configuration:
//...
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:
group: com.mytest
artifact: test-project
version: 1.0.0-SNAPSHOT
Running “gradle clean install” generates the following artifacts in my repository:
~/.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:
testCompile group: "com.mytest", name: "test-project", version:"1.0.0-SNAPSHOT", classifier: "tests"
I get the following output:
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:
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