Gradle build hangs in configuration phase

Hi All,
I have a gradle setup with 15 subprojects.
Some of them reference each other.
When I run ./gradlew it gets stuck at

Configuring > 11/15 projects

and hangs there forever
Starting gradle with --debug outputs the following repeatedly with an interval of ~5sec

09:03:03.649 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] DaemonExpirationPeriodicCheck running
09:03:03.649 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
09:03:03.649 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired.
09:03:03.649 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
09:03:03.650 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
09:03:03.650 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired.
09:03:03.650 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.

Nothing else happens.
Well I guess this can be a cyclic reference, but how do I determine that? Gradle hangs at config phase, so no plugin to get the dependency graph will ever finish.

I also tried to debug the gradle build, but if I pause the JVM while gradle is ‘hanging’ I only see this stacktrace:

Do you have any suggestion on how to find out where the build is hanging?
Currently I use gradle 3.3, but I had this behaviour also on 2.12.

Many thanks in advance.
-chris-

Does this work properly if you run with --no-daemon? Do you have a way to condense your project to a minimal code/applied plugins that cause the issue? Do you see the behavior intermittently or always?

Thanks for you reply.
In the meantime I found out what was the problem. Again it was a custom plugin that went wild in the config phase.
It had nothing to do with cyclic references, just smelly code :wink: