Multiple projects inside one IntelliJ instance

When you are working with multiple projects, for example a number of microservices, it becomes problematic to have an IntelliJ instance open for each of those.

There is a trick that allows us to have multiple projects open inside one IntelliJ instance (this saves time, space and RAM :)).

Basics steps are as follows:

  1. Create a new directory, for example my_projects_workspace
  2. Open IntelliJ and click File -> New -> Project -> Empty Project -> For location, select the directory you just created -> Finish
  3. Now, in command line, place yourself in that directory and do a git checkout for each of the projects you want (optional, but makes sense for organizing stuff)
  4. Now lets add these projects to our IntelliJ project. Open IntelliJ project created in step 2, click File -> New -> Module from existing sources -> Select project to import -> Import module from external model, Select Maven (if using Maven), Next -> Enable auto-import and set SDK -> Finish
  5. Repeat step 4 for each project you want to import