Error when trying to import SpongeVanilla

So I’m trying to set up my IDE (intelliJ) so I can actually use the debugger, and I followed the instructions and got all the modules imported, but when I actually try to run GradleStartServer I get this error:

    [14:50:49 ERROR] [LaunchWrapper]: Unable to launch
java.lang.ClassNotFoundException: net.minecraft.client.Minecraft
	at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:191) ~[launchwrapper-1.11.jar:?]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_221]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_221]
	at java.lang.Class.forName0(Native Method) ~[?:1.8.0_221]
	at java.lang.Class.forName(Class.java:348) ~[?:1.8.0_221]
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:131) ~[launchwrapper-1.11.jar:?]
	at net.minecraft.launchwrapper.Launch.main(Launch.java:28) ~[launchwrapper-1.11.jar:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_221]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_221]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_221]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_221]
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) ~[start/:?]
	at GradleStartServer.main(GradleStartServer.java:10) ~[start/:?]
Caused by: java.lang.NullPointerException
	at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:182) ~[launchwrapper-1.11.jar:?]
	... 12 more

I’ve tried creating a container module and adding SpongeVanilla to that, like it says you may have to do on the docs, but it still produces this error. Any help is appreciated.

That sounds like MCP isnt actvating. How are you launching the server?

Solved by setting the main class of the run config to VanillaServerMain instead of GradleStartServer.