the root project has compile errors that are a result of the providedCompile statement not bringing in the dependent jar. What has changed between gradle 1.4 and 1.5+ because this works fine in 1.4?
I did a clean and made sure the jars were rebuilt. No difference in the behavior. I looked at the log files using debug and I can see that in 1.4 the dependent jar is brought in, but I am now using 1.8 and there is no sign of the dependent jar file. The only relevant lines I see in the 1.8 debug log is this
14:11:40.713 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.DependencyGraphBuilder] Attaching com.sams#SAMS-COMMON;8.6.8(tomcatOnly) to its parents.
I can also see the dependent jar being included in 1.4 and not in the 1.8 log file.
Something has changed semantically, I’m just not able to see it. Also, this issue starts with 1.5 and is consistent through 1.8.
Here is a complete example. Running ‘gradle build’ succeeds with 1.5 and 1.6, but fails with 1.7, 1.8, or master. Raised GRADLE-2909. Thanks for reporting.
apply plugin: "java"
configurations {
other
}
task otherJar(type: Jar) {
archiveName = "sams-global-${version}.jar" // build succeeds if this line is commented out
from sourceSets.main.output
include('bar/**')
}
jar {
include("baz/**") // build succeeds if this line is commented out
}
artifacts {
other otherJar
}
Thanks for giving this a try. I was going to do the same thing to identify the issue, but I’m glad you were able to find it too. Will this be fixed in 1.9 ? I guess I will need to stay at an earlier version for now and I’m surprised no one else has bumped into this.