Java 11 gradle cache picks old version groovy jars

OS - Oracle Linux Server 7.6
Gradle Installed - 5.0
groovy Installed - 3.0.0-SNAPSHOT
JVM - 11.0.1 (Azul Systems, Inc. 11.0.1+13-LTS)
I am running appRunWar but errors out with below warning and exception:

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass$3$1 (file:/home/basdev/.gradle/caches/modules-2/files-2.1/org.codehaus.groovy/groovy/2.3.10/b465f206f244ef4151cb424762343849e2bba64c/groovy-2.3.10.jar) to method java.lang.Object.finalize()
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass$3$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Exception in thread “main” java.lang.ClassCastException: class [B cannot be cast to class [C ([B and [C are in module java.base of loader ‘bootstrap’)

I had a look at and and the error should not come with my installed groovy version.
I have groovy plugin applied and imported groovy.json.JsonSlurper in my build.gradle file.

In WARNING lines it shows gradle cache is picking groovy 2.3.10 which is older version.
I am not sure is this why appRunWar is errors out.
I even tried adding dependency as mentioned in, but no luck.

Could someone help me on how the cache will pick latest groovy version.
Thanks in advance.

Its resolved now, I was using org.akhikhl.gretty plugin which has dependency for groovy version 2.3.10.
Replaced it with org.gretty plugin.
Jetty need to be updated to version >= 9.4.13.v20181111 because of Java 11 support(
Still there are errors on running appRunWar.
Exception in thread “Thread-35” org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ‘:client:grettyRunnerJetty9’. at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.rethrowFailure(
Caused by: org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find org.gretty:gretty-runner-jetty9:2.3.1
Required by:
project :client at org.gradle.internal.resolve.result.DefaultBuildableComponentResolveResult.notFound(

It looks like java 11 and jetty compatibility issue.