I've gone through the regular build artifact process, and can get it to build a JAR. However, the JAR that gets compiled doesn't contain my module code, only the code of the dependencies.
The Output Layout, under Project Structure, lists all the relevant modules i.e.
'abi' compile output
'codegen' compile output
etc...
But none of that module code ends up in the JAR.
Possibly related: I'm not indicating a 'main class' because I'm making a JAR library, which does not have a main class.