Search code examples
mavenintellij-ideaintellij-13

Intellij maven imports have broken classpath


I'm using Intellij 13, I've been using Maven quite happily for awhile now to manage the JAR dependencies.

But the last few I've imported are causing a broken classpath issue, and they're not being installed to the repository.

I though it might be just the JSONPath library, but when I tried to install Selenium drivers it also happened with those libs. I checked the local repository and the directories exist, but the JARs haven't downloaded.

This only started happening recently, and a lot of other dependencies have been installed fine (but not since this issue started happening). I'm really not sure what might have caused it.

Does anyone know how to troubleshoot this? Or why the JARs aren't installing? And can I just trigger an update somehow from Intellij to try to reinstall them?

enter image description here

Quick Edit Here:

I tried installing the modules using Intellij's "add library" feature. It installed them fine, whereas before I was just updating them directly in the pom.xml and it was downloading them.

The library feature seems a little better because it automatically adds them to my output artefacts anyway, but it would be nice if it also updated the pom so I can use it outside of the intellij environment.

So I'm not sure why updating the pom.xml isn't working any more...


Solution

  • I had this problem with the Community version of IntelliJ Community edition. I was able to solve the problem using this process:

    1. Click "Help" menu
    2. Click "Find Action" and type "Maven Settings."
    3. Click "Maven Settings."
    4. Click the arrow next to "Maven" on the left hand side, to see the submenu
    5. Click "Importing"
    6. Check "Import Maven Projects automatically" and click "OK."

    Partial screen shot of "Maven Settings" screen

    This should pull in all of the Maven dependencies from the pom.xml file, without you needing to manually add the libraries.

    I hope this helps.