The error for me was this:
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all files for configuration ':overlays:cas:compileClasspath'.
> Could not resolve velocity:velocity:1.5.
Required by:
project :overlays:cas > org.jasig.cas:cas-server-core:3.5.2.1 > org.opensaml:opensaml:2.5.1-1
> Could not resolve velocity:velocity:1.5.
> inconsistent module metadata found. Descriptor: org.apache.velocity:velocity:1.5 Errors: bad group: expected='velocity' found='org.apache.velocity'
The simple solution is to comment out the include 'overlays:cas' line in settings.gradle so it doesn’t bother to compile CAS, but this is problematic if you’re using the included CAS because you need it to log in.
The real solution is to locate the dependency causing the problem and fix it. In this case, it is the velocity.velocity.1.5 dependency which is required by org.opensaml.opensaml.2.5.1-1 which is required by org.jasig.cas.cas.cas-server-core.3.5.2.1.
I deleted the ~/.m2/repository/velocity/velocity/1.5 directory and the error went away.
tl;dnr
Some information to help troubleshoot these kinds of dependency issues:
In some of the build.gradle files you will see that Gradle is looking for dependencies in your local Maven repository, mavenLocal(), or from the Maven central repository, mavenCentral().
The local maven repository is usually in .m2/repository under your user directory.
Gradle also caches dependencies locally in its own repository, usually in .gradle/caches under your user directory. In my case they are in ~/.gradle/caches/modules-2/files-2.1. You can safely delete the ~/.gradle/caches directory and its subdirectories and Gradle will just download the required dependencies again and put them under the caches directory. Another way to refresh dependencies is to run .gradlew with the --refresh-dependencies option.
Good luck,
Lauren Anderson
Brigham Young University