Intellij not resolving maven dependencies
Answered
I am using intellij to build my maven project. the project build successfully and run the problem is that intellij is not resolving my dependencies.I tried to restart but the problem is not being resolved. I also tried to clean the logs but no luck. Please assist
Please sign in to leave a comment.
You could try File - Invalidate Caches/Restart although be aware that also removes your local history I think
I needed to right-click on pom under project view and "re-import" sorry for the noise.
that's how my maven settings looks like
Here is what worked to me >
1- Right Click the project > Maven > Download Sources
2- Right Click the project > Maven > Reimport
I think #2 is what made it, so probably no need to #1. Anyway, I do not know why I have to reimport the project to make it work. IDE should be smart enough to pickup the new lib once it's updates in the pom.xml
Hi guys,
please try mvn -U idea:idea
It helped me and everything is working fine right now. This command is responsible for downloading project plugins for Intellij. I hope it will help you as well.
For me, the problem is different java versions for project and maven importing settings.
Go to Preferences -> Build, Execution, Deployment -> Maven -> Importing -> JDK for importer (at the bottom) and set to Use Project JDK (in most cases this should be a case)
I don't know how this was changed (maybe I downloaded Java 11) but Intellij, please group some Java versions at the same place if possible
I faced with the same issue today... again =( Usually I remove .idea and %userdir%/.IntellijIdeaX folder to solve such things, but this time I was too lazy to restore all cfgs and found one more solution:
- go to %projectDir%\.idea folder
- delete compiler.xml file
- check misc.xml file, if <option name=ignoredFiles"> and its <set> somehow contains the module that Idea is unable to resolve - just remove it from there
- re-import maven project
I've wasted so many time for this issue for a lot of times, hope it will help you =)
i did all that but still is not resolved
this are all the commands I tried but still no luck
* Configuration (idea.config.path):
~/Library/Preferences/<PRODUCT><VERSION>
* Caches (idea.system.path):
~/Library/Caches/<PRODUCT><VERSION>
* Plugins (idea.plugins.path):
~/Library/Application Support/<PRODUCT><VERSION>
* Logs (idea.log.path):
~/Library/Logs/<PRODUCT><VERSION>
I keep running into this issue.
Maven is cool with the pom dependencies but Intellij is not.
mvn can compile and test but intellij won't build the project.
Tonight it won't recognize that: import org.openqa.selenium.remote.DesiredCapabilities;
is legit and in dependency:
https://intellij-support.jetbrains.com/hc/en-us/community/posts/360003445760/comments/360000452739 > this works for me.
Please see if the workaround from https://youtrack.jetbrains.com/issue/IDEA-239150#focus=streamItem-27-4117814.0-0 helps.
There is a known issue in 2020.1 and 2020.1.1 versions: https://youtrack.jetbrains.com/issue/IDEA-237320 .
Mihailo Stupar Please see if the workaround from https://youtrack.jetbrains.com/issue/IDEA-239150#focus=streamItem-27-4117814.0-0 helps. If the issue remains try to do:
File \ Invalidate caches and restart...
Close your project window (and IntelliJ) and remove all
*.iml
files and the.idea
folder.Delete/Rename
.m2
maven folder.Run
mvn clean install
from the command line.Re-import the project into IntelliJ from Existing sources.
IntelliJ IDEA 2019.1 (Ultimate Edition)
Build #IU-191.6183.87, built on March 27, 2019
************************
JRE: 1.8.0_202-release-1483-b39 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.14.4
that is the version of my intelliJ
Hold on, how is your project building successfully and running if the dependencies aren't resolved?
If your dependencies weren't resolved you wouldn't be able to compile.
What do you actually mean by "intellij is not resolving my dependencies"?
intelliJ is not picking up those methods and it looks like they dnt exist but they do exists
it's highlighting my class with a red lines
Please share IDE log folder zipped and if possible a sample project.
For uploading you can use ftp://ftp.intellij.net/.uploads / https://uploads.services.jetbrains.com or any file sharing service.
Try with all custom plugins disabled and re-create project configuration by re-importing the project completely from Maven pom.xml file via File | New | Project from Existing Sources and selecting main parent pom.xml file to import from.
@Andrey Dernov i have shared my IDE log
IntelliJIdea2019.1.zip is the name of my IDE log
No obvious cause seen in logs. There are however errors related corrupted caches or IDE configuration.
Try close the IDE, delete the /Users/abrmagp/Library/Caches/IntelliJIdea2019.1/ directory, start IDE and re-import project from scratch as Maven project as advised. Make sure the import process competed successfully and that you can build the project by IDE (Build | Rebuild Project action).
ok let me try that
still the same issue
For which symbols do you get "red highlighting" problem? From the attached screenshot it does not look to unresolved Maven dependencies but to unresolved local variables (it does not look related to Maven). Can you share a project to check?
the think the problem is that is failing to pull Lombok dependency
>the think the problem is that is failing to pull Lombok dependency
What makes you think that? Do you see this dependency in Dependencies tab for the module? Can you build project via Build | Rebuild Project action?
Do you use Lombok-generated code? Have you tried lombok plugin?
i'm sorted after following this link
https://stackoverflow.com/questions/14866765/building-with-lomboks-slf4j-and-intellij-cannot-find-symbol-log
For some reason i cannot explain, I was missing the .iml file. In another similar project of my creation from a maven archetype, the iml file was present and the commons-math library of apache for "pointable" using import command. In another project without the iml file (i don't know who when and why this file is created), the library was imported by maven but not "pointable" by import. I just created the .iml file (file name is same of project name), i copied the content from the other project (just a few lines) and now the library was available for use...
If somebody is willing to explain what .iml is used for, i'll appreciate.
Paolo