I spent another hour and found gradle#1095 - while that issue is about running tests it answered my question about TravisCI Java9 vs latest and greatest.
I tried the workaround by setting env variable to force-open java.lang
as follows:
export GRADLE_OPTS=--add-opens java.base/java.lang=ALL-UNNAMED
gradlew tasks
At first it didn’t make a difference until I scratched my head some more and carefully read the output:
FAILURE: Build failed with an exception.
* What went wrong:
Unable to start the daemon process. // <== IMPORTANT
This problem might be caused by incorrect configuration of the daemon. // READ THE LINE ABOVE
For example, an unrecognized jvm option is used.
Please refer to the user guide chapter on the daemon at https://docs.gradle.org/3.3/userguide/gradle_daemon.html
Please read the following process output to find out more:
-----------------------
FAILURE: Build failed with an exception.
* What went wrong:
java.lang.ExceptionInInitializerError (no error message)
Then I tried:
gradlew --no-daemon tasks
...
:buildSrc:build UP-TO-DATE // IT'S WORKING!!!
FAILURE: Build failed with an exception. // almost...
* Where:
Build file '.../build.gradle' line: 19
* What went wrong:
An exception occurred applying plugin request [id: 'com.jfrog.artifactory', version: '4.4.8']
> Failed to apply plugin [id 'com.jfrog.artifactory']
> No signature of method: static java.util.Collections.newSetFromMap() is applicable for argument types: (java.util.concurrent.ConcurrentHashMap) values: [[:]]
I just did a quick test and it appears that Groovy has problems dispatching some calls when ran under Java9. As a quick test I run this in the Groovy shell:
Collections.newSetFromMap([:])
It fails in Groovy 2.4.7 + Java9 with the same exception as above, but succeeds in 2.4.8 + Java9.
Any chance we can get a Gradle Groovy version upgrade for 3.4?