Unable to import maven project in IntelliJ14

僤鯓⒐⒋嵵緔 提交于 2019-12-02 20:11:39

Below one worked for me ;

Go to File > Settings > Build,Execution,Deployment> Build Tools > Maven > Importing .

Change VM options for importer to -Didea.maven3.use.compat.resolver

Solved. I had to remove the IntelliJ project folder (.idea) and create a new project from the existing source clicking on the parent pom. Then, everything worked properly.

I guess that some file was corrupted.


In steps. Initially you have something like:

After deleting the .idea folder you will have:

So you close the project and start one from existing sources:

You select the pom.xml file to create the new project and oveeride the IntelliJ project if one was found.

Now you should see exactly the same as in the first picture.

In my case I'd just upgraded my OS (OSX) and doing so deleted my JDK, so Intellij was quietly failing. Following @JeanValjean's advice meant that the project was no longer loadable at all (I couldn't get to JVM preferences). Looking in ~/Library/Logs/IntelliJIdeaXX/idea.log told me the problem and deleting ~/Library/Caches/IntelliJIdeaXX and ~/Library/Preferences/IntelliJIdeaXX/options/jdk.table.xml let me open the project again and fix the path to the JDK.

I don't know what caused this, all i know it was very easy to fix:

  1. Download maven here and extract it in a place of your choice.
  2. Then, go to File>Settings>Build, Execution, Deployment>Build Tools>Maven.
  3. In Maven home directory, instead of Bundled maven, point it to the folder you just created.
  4. Enjoy.

This worked for me

  1. Go to: File > Settings > Build,Execution,Deployment > Build Tools > Maven > Importing

  2. Change: JDK for importer to your installed JDK instead of IDEA's internal JRE (Use Internal JRE from ../JetBrains/IntelliJ IDEA/jre64)

Also searching in IDEA log files helped me. I found this message:

Caused by: java.io.IOException: Cannot run program "C:\Program Files\JetBrains\IntelliJ IDEA 2017.3.2\jre64\bin\java" (in directory "C:\Program Files\JetBrains\IntelliJ IDEA 2017.3.2\bin"): CreateProcess error=2, File not found

In my case it was my firewall. I use bullguard protection btw, which is pretty strict with its firewall.

Below is the solution that works the best for me:

Go to File > Settings > Build,Execution,Deployment> Build Tools > Maven > Importing :

Change VM options for importer to -Xmx4096m

I got into this same state (unable to import maven project) several times (i was running a load test and hitting the max number of open files on the OS, so normal file saves were erroring out). It probably is a corrupt file causing this. A computer reboot acutally solved it a few times but other times I solved it by switching to command line and running "mvn clean install"

Please first check your internet connection, proxy and firewall. Generally, pom.xml libraries downloading automatically but if there is a thing blocking internet please solve first this problem.

In my case I have zone alarm and it blocks the some apps and services. I check and give a permission for internet outbound/inbound connections.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!