I'm also having the same problem. When I run the commands listed above, it also gives the same problem. i restarted my computer and tried again but it still gave me the same problem. What should I do?
A problem occurred configuring root project 'forge-1.15.1-30.0.50-mdk'.
> Could not resolve all files for configuration ':_compileJava_1'.
> Could not find client-extra.jar (net.minecraft:client:1.15.1).
Searched in the following locations:
file:/Users/Cody/.gradle/caches/forge_gradle/bundeled_repo/net/minecraft/client/1.15.1/client-1.15.1-extra.jar