Search code examples
javamavenintellij-idea

IDEA - after importing maven project, can't see source code


Got a new pc, and trying to import an existing maven project into IDEA (version 2018.3), with following steps:

import -> import project from external model -> maven

But, after importing, there is no src dir, I have tried many times, each time delete .idea/ before re-import.

I remember it did work before, but not this time.

And, I can compile the project successfully with mvn compile, also Eclipse could import it correctly.

Any idea what's wrong, and how to fix it?


Solution

  • First check if your intelliJ is collecting POM dependencies, on large projects it can go for hours. During collecting dependencies you will see no folders, but only root files.

    If the above is not the case, right click on white project area/Maven/Reimport.

    If you don't see it or that doesn't fix the problem, go to File->Project Structure... then choose Modules and check if you have duplicated modules and remove them.