Gradle hangs and CPU at 100%

There is no specific reason to fork, when I searched for similar problem in internet someone tried and worked for them. In my case the CPU is going 100% which is a major concern. I will try with JVIsual VM. Also, when I did the other smaller projects gradle init/gradle build it went well. Only this bigger project has this problem.

Thanks for all the guidance I will get some more metrics and see what is going on.