Inside the folder.idea, has been already created a.gitignore, updated by the ide itself to avoid to commit user related settings that may contains privacy/password data. I tried and it worked. To build a jar file from a module;
On the main menu, choose build | build artifact. 1 here is the official answer of intellij idea 2018.3 help.