Why user gradle.properties is not being replaced by project gradle.properties?


(mashimom) #1

Gradle 1.12 and 2.0 insists on compiling with Java 7 libraries even when project gradle.properties point to Java 6.

./gradlew --version
  ------------------------------------------------------------
Gradle 1.12
------------------------------------------------------------
  Build time:
 2014-04-29 09:24:31 UTC
Build number: none
Revision:
   a831fa866d46cbee94e61a09af15f9dd95987421
  Groovy:
     1.8.6
Ant:
        Apache Ant(TM) version 1.9.3 compiled on December 23 2013
Ivy:
        2.2.0
JVM:
        1.6.0 (IBM Corporation 2.4)
OS:
         Linux 3.13.0-32-generic x86

Even JAVA_HOME is properly set

echo $JAVA_HOME
/usr/lib/j2sdk1.6-ibm

The project ‘gradle.properties’ contains:

org.gradle.daemon=false
org.gradle.java.home=/usr/lib/j2sdk1.6-ibm
org.gradle.parallel=false
JDK6_HOME=/usr/lib/j2sdk1.6-ibm

When running ./gradlew --debug classes I get the following line:

09:58:16.625 [INFO] [org.gradle.launcher.daemon.client.DefaultDaemonStarter] Starting daemon process: workingDir = /home/MY_USER/.gradle/daemon/1.12, daemonArgs: [/home/MY_USER/etc/jdk1_7_ibm/bin/java, -XX:MaxPermSize=256m, -XX:+HeapDumpOnOutOfMemoryError, -Xmx1024m, -Dfile.encoding=UTF-8, -cp, /home/MY_USER/.gradle/wrapper/dists/gradle-1.12-bin/2qvnajdoo11hasdfkikjaci26k/gradle-1.12/lib/gradle-launcher-1.12.jar, org.gradle.launcher.daemon.bootstrap.GradleDaemon, 1.12, /home/MY_USER/.gradle/daemon, 10800000, b4d53266-146a-4d39-a767-e7891807eae5, -XX:MaxPermSize=256m, -XX:+HeapDumpOnOutOfMemoryError, -Xmx1024m, -Dfile.encoding=UTF-8]

I know my user .gradle/gradle.properties is different:

org.gradle.daemon=true
org.gradle.java.home=/home/MY_USER/etc/jdk1_7_ibm
org.gradle.parallel=false

I though that the most local ‘gradle.properties’ would win. If I remove user gradle.properties or set it to JDK 6 it works. Why do I get this unreliable behavior?


(davidmichaelkarr) #2

From the user guide: >The properties file in the user’s home directory has precedence over property files in the project directories.