8

I just freshly installed IntelliJ Community Edition. When I try to import a Maven project, it gets stuck on the step "Scanning Maven Projects" and says its reading ".../pom.xml". It holds here for about 10 minutes, quits out of this window, and then doesn't import the projects at all.

Some other posts have recommended setting up /etc/hosts file, but mine is already set up with 127.0.0.1 localhost. I've set up the proxy information in IntelliJ and in my .m2/settings.xml file as well.

Any suggestions on how I can get IntelliJ just to open up my project?

Best, Keren

Keren
  • 379
  • 6
  • 16
  • can you post the pom.xml of the project you are trying to import? and the relevant part ( proxy and central repo) of the settings.xml – Sammyrulez Sep 21 '16 at 21:05
  • 2
    I just figured it out, it was complaining about the pom.xml but the pom.xml wasn't the actual problem. It was the /etc/hosts file that was throwing the problem. If you map more one value to "localhost" then IntelliJ freaked out for me for some reason. So I uncommented ::1 localhost in my /etc/hosts file and it worked. – Keren Sep 22 '16 at 14:11
  • I modified the etc/hosts file the other day which caused the issue . If you have 127.0.0.1 localhost in your etc/hosts, use are good. – Neethu Lalitha Jan 12 '17 at 15:18
  • Possible duplicate of [unable to import maven project into Intellij Idea :looking for available profile](https://stackoverflow.com/questions/16981224/unable-to-import-maven-project-into-intellij-idea-looking-for-available-profile) – GiovanyMoreno Aug 24 '17 at 12:09
  • See also: https://stackoverflow.com/questions/36473138/cant-import-the-maven-project-in-intellij-idea-2016-1-1/52519992#52519992 – Ambroise Rabier Sep 26 '18 at 14:26

1 Answers1

11

Already answered here unable to import maven project into Intellij Idea :looking for available profile

The solution was to edit the /etc/hosts file and add at the first line:

127.0.0.1 localhost localhost

Also, make sure localhost is mapped only once.

(answered in the comments. I am just leaving this answer for reference as it's one of Google's first results when searching for this problem)

GiovanyMoreno
  • 389
  • 3
  • 13