How to add dependent maven project as sources in Intellij Idea

Note: this project was added previously as a maven dependency, so now we need to add it as a sources.

Project Structure -> Modules -> [+] -> Import Module

go through the wizard…

After that go to maven tab, then select grey root nodes, right click, choose ‘Unignore Projects’

Maybe you need to reopen IDE.

UPD: also you need to reload cashes. I did it by:

  1. change version of the adding library to one of previous
  2. click ‘Import Changes’ on the ‘Maven projects need to be imported’ tooltip
  3. change it back
  4. again click ‘Import Changes’ on the ‘Maven projects need to be imported’ tooltip
How to add dependent maven project as sources in Intellij Idea