Intellij idea cannot resolve anything in maven
Solution 1:
I have encountered this problem,idea cannot download all dependent jar packages using maven,i just tried the following operations:
mvn -U idea:idea
then all the dependent jar packages are download from the maven repository
Please note that idea plugin is retired
Solution 2:
In IntelliJ 12.1.4 I went through Settings --> Maven --> Importing
and made sure the following was selected:
- Import Maven projects automatically
- Create IDEA modules for aggregator projects
- Keep source...
- Exclude build dir...
- Use Maven output...
- Generated souces folders: "detect automatically"
- Phase to be...: "process-resources"
- Automatically download: "sources" & "documentation"
-
Use Maven3 to import project
- VM options for importer: -Xmx512m
This took me from having a lot of unresolved import statements to having everything resolved. I think the key here was using Maven3 to import project... Hopefully this helps.
Solution 3:
I ran into this issue when using IntelliJ 14's bundled Maven 3 instance.
I switched to using my own local Maven instance, via:
Settings -> Build, Execution, Deployment -> Build Tools -> Maven -> Maven Home Directory
Then added the path to my locally installed instance.
This got the dependencies to magically appear.
Solution 4:
I was also getting this error because the project imported main and test folders as modules. Click on Project --> Press F4 --> In Module settings, remove main and test folders and the make the project again. Problem will be resolved.
Solution 5:
I have tried several options, but this one finally solved my problem. I re-imported the project by following these steps in IntelliJ:
- File -> New -> Project From Existing Repositories
Choose your project from 'Select File or Directory to Import'
In the next screen choose 'Import Project From external model', and choose 'Maven.
- In the next step, click the checkbox 'Import Maven projects automatically', (that solved my problem)
- Finish up by choosing profiles if necessary
For me re-importing maven projects did not solve the issue for an existing projects.