In Gradle 1.0-milestone-6 (also saw it in milestone-3), providedCompile seems to be incorrectly stripping transitive dependencies that are also compile dependencies of a project.
Running “gradlew clean war” with the following build.gradle results in a WAR whose WEB-INF\lib only contains logback-core-0.9.24.jar. It is missing slf4j-api-1.6.1.jar.
When I change shiro-core from providedCompile to compile, then slf4j-api-1.6.1.jar (and of course the shiro-core jar) show up in the WAR.
I think that transitive dependecies of providedCompile dependencies should only be stripped from the WAR if they are not explicit dependencies elsewhere. I think, at least
Thanks for all the good work!
apply plugin: 'war'
repositories {
mavenCentral()
}
dependencies {
providedCompile 'org.apache.shiro:shiro-core:1.1.0'
compile 'org.slf4j:slf4j-api:1.6.1'
// A transitive dependency of shiro-core as well
compile 'ch.qos.logback:logback-core:0.9.24'
// Not a transitive dependency of shiro-core
}
task wrapper(type: org.gradle.api.tasks.wrapper.Wrapper) {
gradleVersion = '1.0-milestone-6'
jarFile = '.wrapper/gradle-wrapper.jar'
description = 'Builds the gradlew wrapper'
}