When I manually add dependencies in the pom.xml of my project, let Maven download the dependencies and let IntelliJ build the module, IntelliJ complains about missing libraries. At the same time Maven can find the dependent JARs and build the project.
How can I tell IntelliJ to use the libs which are downloaded by Maven?
Press Ctrl + Shift + A to find actions, and input "reload", you will find the "Reload All Maven Projects". On a Mac, use ⌘ + ⇧ + A instead.
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.
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.
Approach 1
File > Settings... > Build, Execution, Deployment > Build Tools > Maven > Importing > check Import Maven projects automatically
Approach 2
Approach 1
Approach 2
View > Tools Windows > Maven Projects:
or
click on the "Reimport All Maven Projects" icon:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With