You can go to Preferences -> Build, Execution, Deployment -> Build Tools -> Maven -> Importing and check the box that says Import Maven projects automatically.
In Mac, you can do Command + Shift + A, then enter the action reimport, then click on Reimport all Maven projects.
You can go to Preferences -> Build, Execution, Deployment -> Build Tools -> Maven -> Importing and check the box that says Import Maven projects automatically.
In Mac, you can do Command + Shift + A, then enter the action reimport, then click on Reimport all Maven projects.
As mentioned by @maheeka in the question's comments, if the project is a Maven project, the simplest way to achieve updating changed external libraries is to right-click on the project, and select Maven > Reload project.
You can actually see IntelliJ re-indexing the changed libraries individually during the operation in the bottom right status bar.
Tested on v2021.1 Ultimate.
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 or Maven > Reload (for newer versions of IntelliJ)
- 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
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.