Gradle gives me the follow error when I do run it with no arguments.
Could not create service of type TaskHistoryStore using TaskExecutionServices.createCacheAccess().
> Failed to create parent directory '/opt/local/bin/.gradle' when creating directory '/opt/local/bin/.gradle/3.2.1/taskArtifacts'
I installed gradle using macports and it placed the gradle bin in /opt/local/bin
I have defined GRADLE_USER_HOME=~/.gradle and created the directory with appropriate permissions.
The gradle daemon is running. Previously the daemon refused to start for the same error quoted above and thats why I defined GRADLE_USER_HOME.
I still get the parent error though and it is still trying to refer to the install location for gradle when I would rather it was trying to create stuff in my user area rather than a area defined to be writable only to root.
Looking at the debug output from gradle, it would seem to be defining the current directory to be equal to the location where the gradle bin is found, so /opt/local/bin which is not the current directory from which I am executing gradle.
$ which gradle
/opt/local/bin/gradle
$ pwd
/Users/Me
$ gradle --debug
06:00:19.626 [INFO] [org.gradle.internal.nativeintegration.services.NativeServices] Initialized native services in: /Users/Me/.gradle/native
06:00:20.124 [INFO] [org.gradle.internal.buildevents.BuildLogger] Starting Build
06:00:20.128 [DEBUG] [org.gradle.internal.buildevents.BuildLogger] Gradle user home: /Users/Me/.gradle
06:00:20.129 [DEBUG] [org.gradle.internal.buildevents.BuildLogger] Current dir: /opt/local/bin
06:00:20.129 [DEBUG] [org.gradle.internal.buildevents.BuildLogger] Settings file: null
06:00:20.130 [DEBUG] [org.gradle.internal.buildevents.BuildLogger] Build file: null
06:00:20.133 [DEBUG] [org.gradle.initialization.buildsrc.BuildSourceBuilder] Starting to build the build sources.
06:00:20.133 [DEBUG] [org.gradle.initialization.buildsrc.BuildSourceBuilder] Gradle source dir does not exist. We leave.
06:00:20.134 [DEBUG] [org.gradle.initialization.DefaultGradlePropertiesLoader] Found env project properties: []
06:00:20.134 [DEBUG] [org.gradle.initialization.DefaultGradlePropertiesLoader] Found system project properties: []
06:00:20.308 [DEBUG] [org.gradle.initialization.ScriptEvaluatingSettingsProcessor] Timing: Processing settings took: 0.174 secs
06:00:20.310 [INFO] [org.gradle.internal.buildevents.BuildLogger] Settings evaluated using settings file '/master/settings.gradle'.
I’ve looked through the forums and thats where I got the tip about the GRADLE_USER_HOME and it solved part of the problem but not all of it. I think its getting the current dir wrong. Any suggestions ?