How can I make IntelliJ IDEA update my dependencies from Maven?
It turns out IntelliJ does not pick up added dependencies from the local Maven repository. We have to tell IntelliJ to reimport the pom.xml.
- Open the project view in IntelliJ
- Right click the pom.xml file and select Maven - Reimport
- If this works for you IntelliJ will add the dependencies to the project
- Check the if the dependencies you need are added in
- File - Project Structure - Project Settings - Libraries
- and File - Project Structure - Modules - Dependencies
IntelliJ IDEA 2016
Import Maven projects automatically
Approach 1
File > Settings... > Build, Execution, Deployment > Build Tools > Maven > Importing > check Import Maven projects automatically
Approach 2
- press Ctrl + Shift + A > type "Import Maven" > choose "Import Maven projects automatically" and press Enter > check Import Maven projects automatically
Reimport
Approach 1
- In Project view, right click on your project folder > Maven > Reimport
Approach 2
View > Tools Windows > Maven Projects:
- right click on your project > Reimport
or
click on the "Reimport All Maven Projects" icon:
You don't have to reimport manually each time. You can enable auto-import as documented here. Change this in Settings -> Maven -> Import Maven projects automatically.