IntelliJ should download and add all your dependencies to the project's classpath automatically as long as your POM is compliant and all the dependencies are available.
When importing Maven projects into IntelliJ an information box usually comes up asking you if you want to configure Auto-Import for Maven projects. That means that if you make any changes to your POM those changes will be loaded automatically.
You can enable such feature going to File > Settings > Maven > Importing, there is a checkbox that says "Import Maven projects automatically".
If that doesn't help, then I would suggest to make a full clean-up and start again:
- Close your project window (and IntelliJ) and remove all
*.iml
files and all .idea
folders (there should be one per module)
- Run
mvn clean install
from the command line
- Re-import the project into IntelliJ and pay attention when it asks you to enable auto-import
IntelliJ 2016 Update:
The Import Maven Projects automatically setting has been moved to Build, Execution, Deployment > Build Tools > Maven > Importing in your IntelliJ preferences.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…