Running Sponge code outside of Minecraft?

Rather than creating a plugin, is it possible with Sponge to create a class with the usual Java main method, using the Sponge API, and run it without having to compiling it as a plugin and running Minecraft?

No. One of the main things you need to do with Java is compile classes for them to run (there is a exception that came with Java 11 that was designed to test java code … But that cannot use external libraries).

Sponge uses Mixins (which manipulate code that is already present) to gain its functionality, so for Sponge to run, it requires minecraft.

There are parts of sponge that can run without minecraft, such as SpongeAPI (the layer of sponge that plugins talk to), NinjaLib (how config files are made and read), etc. But sponge as a whole contains both SpongeCommon and either SpongeVanilla or SpongeForge which require Minecraft.

Out of curiosity. Why would you want such A thing? Trying to think of a use case for your query. Ive thought of a couple but they use only parts of your whole query