Is sourceCompatibility ignored when property set?

When compiling a Java project I set the property to point to a JDK 8 distribution. In my build.gradle file I set:

sourceCompatibility = 1.6 targetCompatibility = 1.6

When I try to compile, it fails with the message:

javacTask: target release 1.6 conflicts with default source release 1.8

This also occurs if I set the to point to a JDK 7. I have seen this on Gradle 1.12 as well as Gradle 2.0. All builds are being done on Linux.

When I use JAVA_HOME instead of specifying the property, I do not see this problem and my compile produces the appropriately versioned class files.

Pilot error. We were setting the sourceCompatibility down in one of our plugins, which was causing the -source flag to not be passed to javac by gradle.